Use angular service instead of window object
Merge pull request #1658 from geoadmin/dev_window

Use  service $window instead of window object