W
W
winstan2016-06-27 16:33:16
JavaScript
winstan, 2016-06-27 16:33:16

Can Angular have an "event" that fires when the scope variables change?

Can Angular have an "event" that fires when the scope variables change?
This is what should be the result, the user does some actions in the application and if he changes some indicator, what would it be sent to the server.
I fully understand that you can make a super setinterval that will compare each variable, but in my opinion this bike is still the same, but I want to increase the quality.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex, 2016-06-27
@streetflush

$watch
https://docs.angularjs.org/api/ng/type/$rootScope.Scope

N
Nicholas, 2016-06-27
@healqq

For angular 1.5 there is $onChanges ( for components).
For inputs - ng-model + ng-change is enough

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question