I have a text box:
<input type="text" ng-model="SearchText" >
And a link:
<a href="#signout" ng-click="SearchText=''">Sign out</a>
I want to exectue both in the above hyperlink. ng-click
to empty text-box and #signout
will ng-route
to signout HTML and controller.
But I can see href overrides ng-click
in Angular.js
How to execute both?
If you use ng-mouseup
or ng-mousedown
depending on when you need the event to fire it will not override ng-href
like ng-click
does.
<a ng-href="#signout" ng-mouseup="SearchText=''">Sign out</a>