function config($stateProvider, $urlRouterProvider, $ocLazyLoadProvider, IdleProvider, KeepaliveProvider) { // Configure Idle settings IdleProvider.idle(5); // in seconds IdleProvider.timeout(120); // in seconds $urlRouterProvider.otherwise("/index/main"); //$urlRouterProvider.otherwise("/dashboards/dashboard_main"); $ocLazyLoadProvider.config({ // Set to true if you want to see what and when is dynamically loaded debug: false }); $stateProvider.state('index', { abstract: true, url: "/index", templateUrl: "views/common/content.html", }).state('index.main', { url: "/main", templateUrl: "views/main.html", data: { pageTitle: 'Example view' } }).state('index.minor', { url: "/minor", templateUrl: "views/minor.html", data: { pageTitle: 'Example view' } }).state('login', { url: "/login", templateUrl: "views/login.html", data: { pageTitle: 'Login', specialClass: 'gray-bg' }, controller: "LoginController" }).state('dashboards', { abstract: true, url: "/dashboards", templateUrl: "views/common/content.html", }).state('dashboards.main', { url: "/dashboard_main", templateUrl: "views/dashboard.html", resolve: { loadPlugin: function ($ocLazyLoad) { return $ocLazyLoad.load([ { serie: true, name: 'angular-flot', files: [ 'js/plugins/flot/jquery.flot.js', 'js/plugins/flot/jquery.flot.time.js', 'js/plugins/flot/jquery.flot.tooltip.min.js', 'js/plugins/flot/jquery.flot.spline.js', 'js/plugins/flot/jquery.flot.resize.js', 'js/plugins/flot/jquery.flot.pie.js', 'js/plugins/flot/curvedLines.js', 'js/plugins/flot/angular-flot.js', ] }, { name: 'angles', files: ['js/plugins/chartJs/angles.js', 'js/plugins/chartJs/Chart.min.js'] }, { name: 'angular-peity', files: ['js/plugins/peity/jquery.peity.min.js', 'js/plugins/peity/angular-peity.js'] } ]); } } }).state('miscellaneous.idle_timer', { url: "/idle_timer", templateUrl: "views/idle_timer.html", data: { pageTitle: 'Idle timer' }, resolve: { loadPlugin: function ($ocLazyLoad) { return $ocLazyLoad.load([ { name: 'cgNotify', files: ['css/plugins/angular-notify/angular-notify.min.css','js/plugins/angular-notify/angular-notify.min.js'] } ]); } } }) } angular.module('inspinia').config(config).run(function($rootScope, $state) { $rootScope.$state = $state; });