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,417
  • 12
  • 28
  • 49
Pato Salazar
  • 1,367
  • 11
  • 21

1 Answers1

0

I think that's exactly you are looking for:

<input ng-change="userDecision || doSomething()">
Serginho
  • 6,771
  • 2
  • 23
  • 50
  • 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