I have a button like this
<button ng-click="method = 'create'; title = 'Create'>create</button> <button ng-click="method = 'update'; title = 'Update'>update</button>
and this one
<button ng-click="create(param)">{{ title }}</button> <button ng-click="update(param)">{{ title }}</button>
The code above works fine, but I want to make it dynamic.
so i modify it as below.
<button ng-click="{{ method }}(param)">{{ title }}</button>
This does not work, I do not know why, although if I check the element, the code above generates the corrected code, as mentioned earlier.
angularjs
Donny gunawan
source share