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

Is angular a ui framework?

0 Answers  


What does this line do? @Hostbinding(‘[class.valid]’) is valid?

0 Answers  


What is angular libraries?

0 Answers  


Can we set an angular variable from php session variable without sending an http request?

0 Answers  


What is @injectable providedin root?

0 Answers  






What is injector in angular?

0 Answers  


Tell me which browsers does Angular work with?

0 Answers  


What is a template in angular 2?

0 Answers  


What is constant?

0 Answers  


What is dependency injection (di)? Why use?

0 Answers  


What is router outlet in angular?

0 Answers  


Explain .config() and .run() methods in angularjs?

0 Answers  


Categories