(notificationsArray, notificationObj)
| 8 | var notificationsService = {}; |
| 9 | |
| 10 | var addNotification = function (notificationsArray, notificationObj) { |
| 11 | if (!angular.isObject(notificationObj)) { |
| 12 | throw new Error("Only object can be added to the notification service"); |
| 13 | } |
| 14 | notificationsArray.push(notificationObj); |
| 15 | return notificationObj; |
| 16 | }; |
| 17 | |
| 18 | $rootScope.$on('$routeChangeSuccess', function () { |
| 19 | notifications.ROUTE_CURRENT.length = 0; |