Difference between $window and window in Ionicframework

What is the exact difference between $window and window in ionic-framework?

For example, in the localstorage tutorial at learn.ionicframework.com/formulas/localstorage/ both $window and window are used.

$window is an angular.js service wrapping the global variable window, mainly to make it possible to mock it for unit tests.

see here for an explanation:

https://docs.angularjs.org/api/ng/service/$window

if you look at the source you see that there is not much more behind it:

https://github.com/angular/angular.js/blob/master/src/ng/window.js#L45

Both are not related to ionic-framework as such.

window is a browser object which represents the window containing the DOM. 'document' that we use for javascript is a property of window object window.document.

refer this browser window object

where $window is a service created in angular which can be injected to any service or controller written in angular again to make use of its APIs.

refer to this for $window

$window