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
How are the services injected to your application?
Wht do we use directive?
What is command for create & execute project in angular 4?
How to create datepicker in angular 4?
What is the future of angularjs?
What does ‘ng-serve’ do?
Explain npm?
What is the difference between ng-model and ng-bind in angularjs?
Explain the validation feature in angularjs?
What is the need for typescript in angular 2?
What is "track by" in angularjs and how does it work?
What is react lazy?
Is angular harder than react?
Just-in-time (jit) compiles the app in the browser, at runtime, as the application loads – this is the standard development approach. Jit is useful for development, but its performance concerns me – how would jit scale for enterprise-level applications?
What is aot compilation? Why use in angular 2?