Service and directive that allows detection of viewport resizing in AngularJS