What is the difference between $watch and $observe?
Answer Posted / chaitanya
$watch is a method on the scope object which is used to watch expressions. The expression can be either strings or functions.
$observe is a method on the attrs object which is only used to observe the value change of a DOM attribute. It is only used inside directives.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is the difference between Rootscope and Scope in AngularJS?
What is the use of ngfor directive in angular?
Write the cli command to generate a component in angular 4?
What is the scope of a $scope?
What are the web application security risks that a web developer should avoid while doing development using angularjs?
What is activatedroute in routes?
What is angular 2 and typescript?
Explain what is directive and mention what are the different types of directive?
What is latest version of angularjs?
List some inbuilt services in angularjs?
Explain validations done in angularjs?
How AngularJS will automatically be initialized?
What is aot and jit in angular?
Should you use angular?
What is singleton object?