Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 1 | /// <reference path="../typings/index.d.ts" /> |
| 2 | |
| 3 | export default routesConfig; |
| 4 | |
| 5 | /** @ngInject */ |
| 6 | function routesConfig($stateProvider: angular.ui.IStateProvider, $urlRouterProvider: angular.ui.IUrlRouterProvider, $locationProvider: angular.ILocationProvider) { |
| 7 | $locationProvider.html5Mode(false).hashPrefix(''); |
| 8 | $urlRouterProvider.otherwise('/'); |
| 9 | |
Matteo Scandolo | e0d71ea | 2016-12-19 11:56:12 -0800 | [diff] [blame] | 10 | // declare here static endpoints, |
| 11 | // core related endpoints are dynamically generated |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 12 | $stateProvider |
| 13 | .state('xos', { |
| 14 | abstract: true, |
| 15 | url: '/', |
| 16 | component: 'xos' |
| 17 | }) |
| 18 | .state('xos.dashboard', { |
| 19 | url: '', |
| 20 | parent: 'xos', |
| 21 | template: '<h1>Dashboard</h1>' |
| 22 | }) |
Matteo Scandolo | e0d71ea | 2016-12-19 11:56:12 -0800 | [diff] [blame] | 23 | .state('xos.core', { |
| 24 | url: 'core', |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 25 | parent: 'xos', |
Matteo Scandolo | e0d71ea | 2016-12-19 11:56:12 -0800 | [diff] [blame] | 26 | abstract: true, |
| 27 | template: '<div ui-view=></div>' |
| 28 | }) |
| 29 | .state('test', { |
Matteo Scandolo | ee655a1 | 2016-12-19 15:38:43 -0800 | [diff] [blame] | 30 | url: '/test/:id?', |
Matteo Scandolo | e0d71ea | 2016-12-19 11:56:12 -0800 | [diff] [blame] | 31 | parent: 'xos.core', |
| 32 | template: '<h1>Child</h1>' |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 33 | }); |
| 34 | } |