blob: e972d220b32ff4537634ad6335774e3df68afb2c [file] [log] [blame]
Matteo Scandolof6acdbe2016-12-13 10:29:37 -08001/// <reference path="../typings/index.d.ts" />
2
3export default routesConfig;
4
5/** @ngInject */
6function routesConfig($stateProvider: angular.ui.IStateProvider, $urlRouterProvider: angular.ui.IUrlRouterProvider, $locationProvider: angular.ILocationProvider) {
7 $locationProvider.html5Mode(false).hashPrefix('');
8 $urlRouterProvider.otherwise('/');
9
Matteo Scandoloe0d71ea2016-12-19 11:56:12 -080010 // declare here static endpoints,
11 // core related endpoints are dynamically generated
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080012 $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 Scandoloe0d71ea2016-12-19 11:56:12 -080023 .state('xos.core', {
24 url: 'core',
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080025 parent: 'xos',
Matteo Scandoloe0d71ea2016-12-19 11:56:12 -080026 abstract: true,
27 template: '<div ui-view=></div>'
28 })
29 .state('test', {
Matteo Scandoloee655a12016-12-19 15:38:43 -080030 url: '/test/:id?',
Matteo Scandoloe0d71ea2016-12-19 11:56:12 -080031 parent: 'xos.core',
32 template: '<h1>Child</h1>'
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080033 });
34}