blob: 3c30d62e70e08a3a65940ed90a5a4496f2537a75 [file] [log] [blame]
Matteo Scandolo686547a2017-08-08 13:05:25 -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
Arpit Agarwal43978742016-08-09 15:38:25 -070019/* eslint-disable angular/ng_module_name */
20(function(){
21 'use strict';
Arpit Agarwal43978742016-08-09 15:38:25 -070022 angular.module('ngXosLib', ['xos.helpers', 'ui.router'])
Arpit Agarwal43978742016-08-09 15:38:25 -070023 .config(($stateProvider) => {
24 $stateProvider
25 .state('form-test', {
26 url: '/form/',
27 template: '<form-test></form-test>'
28 })
29 .state('table-test', {
30 url: '/table/',
31 template: '<table-test></table-test>'
32 })
33 .state('alert-test', {
34 url: '/alert/',
35 template: '<alert-test></alert-test>'
36 })
37 .state('field-test', {
38 url: '/field/',
39 template: '<field-test></field-test>'
40 })
Matteo Scandoloe57712f2016-09-21 15:27:36 -070041 .state('smart-table-test', {
42 url: '/smartTable/',
43 template: '<smart-table-test></smart-table-test>'
44 })
Arpit Agarwal43978742016-08-09 15:38:25 -070045 })
46 .component('navDemo', {
47 restrict: 'E',
48 bindings: {},
49 bindToController: true,
50 controllerAs: 'vm',
51 templateUrl: 'templates/nav.dev.html',
52 controller: function ($rootScope) {
53
54 this.active = 'form';
55
Matteo Scandoloe57712f2016-09-21 15:27:36 -070056 $rootScope.$on('$stateChangeSuccess', (event, toState) => {
Arpit Agarwal43978742016-08-09 15:38:25 -070057 let strSelected = toState.url.split('/').join('');
58 this.active = strSelected.charAt(0).toUpperCase() + strSelected.slice(1);
59 });
60
61 this.config = {
62 actions: [
63 {
64 label: 'Form',
65 class: '',
66 link: '/#/form/'
67 },
68 {
69 label: 'Field',
70 class: '',
71 link: '/#/field/'
72
73 },
74 {
75 label: 'Alert',
76 class: '',
77 link: '/#/alert/'
78
79 },
80 {
81 label: 'Table',
82 class: '',
83 link: '/#/table/'
Matteo Scandoloe57712f2016-09-21 15:27:36 -070084 },
85 {
86 label: 'SmartTable',
87 class: '',
88 link: '/#/smartTable/'
Arpit Agarwal43978742016-08-09 15:38:25 -070089 }
90 ]
91 }
92 }
93 });
94
95})();