Adding relations links to table
Change-Id: I5dd2d206a6da7fec163342f54f1143a7783f7758
diff --git a/src/index.ts b/src/index.ts
index ca6ca34..c23c075 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -29,6 +29,7 @@
import {IXosConfigHelpersService} from './app/core/services/helpers/config.helpers';
import {StyleConfig} from './app/config/style.config';
import {IXosResourceService} from './app/datasources/rest/model.rest';
+import {IXosAuthService} from './app/datasources/rest/auth.rest';
export interface IXosState extends angular.ui.IState {
data: IXosCrudData;
@@ -68,10 +69,19 @@
RuntimeStates: IRuntimeStatesService,
NavigationService: IXosNavigationService,
ConfigHelpers: IXosConfigHelpersService,
+ AuthService: IXosAuthService,
+ $transitions: any,
toastr: ng.toastr.IToastrService,
PageTitle: IXosPageTitleService
) => {
+ // check the user login
+ $transitions.onSuccess({ to: '**' }, (transtion) => {
+ if (!AuthService.getUser()) {
+ $state.go('login');
+ }
+ });
+
// save the last visited state before reload
const lastRoute = window.location.hash.replace('#', '');