blob: 05165c0483dfd3f39a1aa7d43f574b3613a66260 [file] [log] [blame]
Matteo Scandolofb46ae62017-08-08 09:10:50 -07001
2/*
3 * Copyright 2017-present Open Networking Foundation
4
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8
9 * http://www.apache.org/licenses/LICENSE-2.0
10
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080019/// <reference path="../typings/index.d.ts" />
20
21export default routesConfig;
22
23/** @ngInject */
24function routesConfig($stateProvider: angular.ui.IStateProvider, $urlRouterProvider: angular.ui.IUrlRouterProvider, $locationProvider: angular.ILocationProvider) {
25 $locationProvider.html5Mode(false).hashPrefix('');
Matteo Scandolo9b460042017-04-14 16:24:45 -070026 $urlRouterProvider.otherwise('/loader');
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080027
Matteo Scandoloe0d71ea2016-12-19 11:56:12 -080028 // declare here static endpoints,
29 // core related endpoints are dynamically generated
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080030 $stateProvider
Matteo Scandolo9b460042017-04-14 16:24:45 -070031 .state('loader', {
32 url: '/loader',
33 component: 'xosLoader',
34 data: {
35 specialClass: 'blank'
36 }
37 })
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080038 .state('xos', {
39 abstract: true,
40 url: '/',
41 component: 'xos'
42 })
43 .state('xos.dashboard', {
Matteo Scandolo9b460042017-04-14 16:24:45 -070044 url: 'dashboard',
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080045 parent: 'xos',
Matteo Scandolod62ea792016-12-22 14:02:28 -080046 template: '<xos-dashboard></xos-dashboard>'
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080047 })
Matteo Scandoloe0d71ea2016-12-19 11:56:12 -080048 .state('xos.core', {
49 url: 'core',
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080050 parent: 'xos',
Matteo Scandoloe0d71ea2016-12-19 11:56:12 -080051 abstract: true,
Matteo Scandolo1aee1982017-02-17 08:33:23 -080052 template: '<div ui-view></div>'
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080053 });
54}