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 angular elements?

0 Answers  


What are services in angular?

0 Answers  


What is angular 4?

0 Answers  


What is modules in angular?

0 Answers  


What is directive role?

0 Answers  


how to set a custom header on the request?

0 Answers  


What is the use of @viewchild?

0 Answers  


Difference between angular 2, 4, 5, 6, &7?

0 Answers  


What are events in angularjs?

0 Answers  


Explain what directives are? Mention some of the most commonly used directives in angularjs application?

0 Answers  


What is angular testing? What are isolated unit tests? What are angular testing utilities?

0 Answers  


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

0 Answers  


Categories