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
Explain angularjs digest cycle?
What are the differences between angular and angular js?
What are the key differences between angular expressions and javascript expressions?
What is the best way to declare and access a global variable in angular 2?
What angular components can be defined within AngularJS templates?
What is ng bind in angular?
What is one-way bindings?
What is primeng? How can it be used with angular 2?
What is injector?
How to load external css style into angular 2?
What is factory in angularjs?
Explain e2e testing of angular js applications.
Explain why there are two “destroy” events associated with the termination of scope in angularjs?
What is share module?
Difference between services and factory.