この問題を解決するために工場を使用してください。ページを変更すると、データは工場やサービスに保持されます。
angular.module('App', [...])
.factory('NotificationFactory', function() {
var notificationTypes: [ { NotificationType: '*', NotificationTitle: 'All notifications' },
{ NotificationType: '0', NotificationLabel: 'System Alert', NotificationTitle: 'System alerts' },
{ NotificationType: '1', NotificationLabel: 'Pending Task', NotificationTitle: 'Pending tasks' },
{ NotificationType: '2', NotificationLabel: 'Update', NotificationTitle: 'Updates' },
{ NotificationType: '3', NotificationLabel: 'Missed Message', NotificationTitle: 'Missed messages' }
];
return notificationTypes;
})
アプリのさまざまな部分でデータを共有するために、角度サービスまたは工場を使用します。 – charlietfl
変更しない場合は、定数としてエクスポートすることもできます。さもなければ、@ charlierflのアドバイスに従ってください。 –