What is the difference between $watch and $observe?
Answer / 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 |
What is spa in angular?
What is typescript in Angular 8?
What is the possible order of lifecycle hooks in angular?
What is internationalization?
What is router imports?
Why is this project called "AngularJS"? Why is the namespace called "ng"?
Explain directive in AngularJS?
How do you share data between controllers?
What is the difference between directives and services?
What is share module?
What is angular json file?
Is angular harder than react?