What is the difference between $watch and $observe?



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

Post New Answer

More AngularJS Interview Questions

When should we use angular?

0 Answers  


Is typescript an oop?

0 Answers  


What is $injector and $inject?

0 Answers  


What is attribute directive in angular?

0 Answers  


What are zones? What is change detection?

0 Answers  






What are the data bindings m angular?

0 Answers  


What is lazy loading in angular?

0 Answers  


What are the difference between angular 4 & angular 5?

0 Answers  


How to use angular datepicker in angular 5/4 applications?

0 Answers  


What is the main purpose of find index in angularjs?

0 Answers  


What is primitive data type?

0 Answers  


Does typescript have a future?

0 Answers  


Categories