angularjs - calling two different functions using ng-click -


i trying call 2 different functions using ng-click="reset();search()" isn't working. correct way of using ng-click multiple functions?

your html should (vm 'controller'):

<a ng-click="vm.multiplemethodcalls()">link text</a> 

your controller should have method (es5 code style) calls 2 other (or more if want) methods:

function multiplemethodcalls() {   this.reset();   this.search(); } 

what not want litter templates more , more code , logic. remember saying 'kiss', keep simple stupid, simpler better. moving logic controller easy understand , allows little more control.


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -