1
+ import heading from '../../components/notifications/heading.html' ;
2
+ import notificationBody from '../../components/notifications/notification-body.html' ;
3
+ import notificationFooter from '../../components/notifications/notification-footer.html' ;
4
+
1
5
/** @ngInject */
2
6
export function NavigationController ( Text , Navigation , Session , API_BASE , ShoppingCart , $scope , $uibModal , $state , EventNotifications , ApplianceInfo , CollectionsApi , RBAC , Language , lodash , $rootScope , sprintf ) {
3
7
const vm = this
@@ -60,7 +64,6 @@ export function NavigationController (Text, Navigation, Session, API_BASE, Shopp
60
64
helpMenu : RBAC . hasAny ( [ 'about' , 'product' , 'documentation' ] )
61
65
}
62
66
EventNotifications . setToastDisplay ( vm . permissions . suiNotifications )
63
- const appBasePath = process . env . NODE_ENV === 'production' ? '' : 'assets/'
64
67
angular . extend ( vm , {
65
68
state : Navigation . state ,
66
69
text : Text . app ,
@@ -72,9 +75,10 @@ export function NavigationController (Text, Navigation, Session, API_BASE, Shopp
72
75
notificationsDrawerShown : false ,
73
76
newNotifications : false ,
74
77
html : {
75
- heading : `${ appBasePath } html/heading.html` ,
76
- notificationBody : `${ appBasePath } html/notification-body.html` ,
77
- notificationFooter : `${ appBasePath } html/notification-footer.html` ,
78
+ // injected into templateCache by navigationInit
79
+ heading : 'notifications/heading.html' ,
80
+ notificationBody : 'notifications/notification-body.html' ,
81
+ notificationFooter : 'notifications/notification-footer.html' ,
78
82
} ,
79
83
handleItemClick : handleItemClick ,
80
84
toggleNotificationsList : ( ) => { vm . notificationsDrawerShown = ! vm . notificationsDrawerShown } ,
@@ -250,3 +254,9 @@ export function NavigationController (Text, Navigation, Session, API_BASE, Shopp
250
254
}
251
255
}
252
256
257
+ /** @ngInject */
258
+ export const navigationInit = function ( $templateCache ) {
259
+ $templateCache . put ( 'notifications/heading.html' , heading ) ;
260
+ $templateCache . put ( 'notifications/notification-body.html' , notificationBody ) ;
261
+ $templateCache . put ( 'notifications/notification-footer.html' , notificationFooter ) ;
262
+ } ;
0 commit comments