use AngularJS version of $window

This makes unit testing easier as it can be mocked out easier