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

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -