What is difference between $window and window in AngularJS?



What is difference between $window and window in AngularJS?..

Answer / chaitanya

$window is an Angular service which reference to the browser's window object. The window object is globally available in JavaScript; it causes testability problems, because it is a global variable. Angular refer to it through the $window service, so that it can be overridden, removed or mocked for testing.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More AngularJS Interview Questions

Explain factory method in angularjs?

0 Answers  


How many types of data bindings are there in angularjs?

0 Answers  


What is transclusion in angular?

0 Answers  


What are the security threats should we be aware of in angular 2?

0 Answers  


What is the use of interceptors in angular 4?

0 Answers  


Which Angular Directive Would You Use To Hide An Element From The DOM Without Modifying Its Style?

0 Answers  


What are some differences between angular 2 and 4?

0 Answers  


What is router imports?

0 Answers  


What is a provider in angularjs?

0 Answers  


How will you initialize a select box with options on page load?

0 Answers  


Explain formgroup and formcontrol in angular?

0 Answers  


What are ng-repeat special variables?

1 Answers  


Categories