change window to angular $window in notification service