0

Hi I want to know is there is a way to stop a ng-change function from been executed programatically.

I am building a search suggestions feature that calls an API using ng-change (passing the input, send it to a service, then back to the controller with the model created). But If the user decides, she/he can click a button to disable the feature. As far as I know, I can make stop the API calls, but not the event itself from being fired.

Any suggestions are more than welcome.

Jonathan Eustace
  • 2,469
  • 12
  • 31
  • 54
Pato Salazar
  • 1,447
  • 12
  • 21

1 Answers1

0

I think that's exactly you are looking for:

<input ng-change="userDecision || doSomething()">
Serginho
  • 7,291
  • 2
  • 27
  • 52
  • What else you need? I solved your problem. User decision is a bool variables, if use wants can disable doSomethind() setting userDecision variable to false. – Serginho Jan 19 '16 at 08:45