How to use $scope.$Watch and $scope.$Apply in angularjs?



How to use $scope.$Watch and $scope.$Apply in angularjs?..

Answer / Kiran Chhabra

$scope.$watch is used to watch for changes in a scope property and execute a function when the watched property changes. $scope.$apply is used to trigger a digest cycle, allowing AngularJS to update the view based on new data or changed properties. It should generally not be necessary to call $scope.$apply manually in most scenarios.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More AngularJS Interview Questions

How prevents html dom based cross site scripting (xss) attacks?

1 Answers  


What is the ngmodule?

1 Answers  


Explain system.config.ts file used in angular?

1 Answers  


Angular 4 grid with crud operations what is angular router?

1 Answers  


What is internationalization and how to implement it in angular js?

1 Answers  


What is the difference between lazy loading and eager loading in angular 2?

1 Answers  


What is template? Why use? Detail?

1 Answers  


How to format a date in angularjs?

1 Answers  


What is mobile angular ui?

1 Answers  


Is react backend or frontend?

1 Answers  


Do you know scope in angular?

1 Answers  


Explain the difference between a factory and a service in angularjs?

1 Answers  


Categories