blob: 445374d5da75099f7251983ce49cddea4f84b15f [file] [log] [blame]
Arpit Agarwal43978742016-08-09 15:38:25 -07001/* eslint-disable angular/ng_module_name */
2(function(){
3 'use strict';
Arpit Agarwal43978742016-08-09 15:38:25 -07004 angular.module('ngXosLib', ['xos.helpers', 'ui.router'])
Arpit Agarwal43978742016-08-09 15:38:25 -07005 .config(($stateProvider) => {
6 $stateProvider
7 .state('form-test', {
8 url: '/form/',
9 template: '<form-test></form-test>'
10 })
11 .state('table-test', {
12 url: '/table/',
13 template: '<table-test></table-test>'
14 })
15 .state('alert-test', {
16 url: '/alert/',
17 template: '<alert-test></alert-test>'
18 })
19 .state('field-test', {
20 url: '/field/',
21 template: '<field-test></field-test>'
22 })
Matteo Scandoloe57712f2016-09-21 15:27:36 -070023 .state('smart-table-test', {
24 url: '/smartTable/',
25 template: '<smart-table-test></smart-table-test>'
26 })
Arpit Agarwal43978742016-08-09 15:38:25 -070027 })
28 .component('navDemo', {
29 restrict: 'E',
30 bindings: {},
31 bindToController: true,
32 controllerAs: 'vm',
33 templateUrl: 'templates/nav.dev.html',
34 controller: function ($rootScope) {
35
36 this.active = 'form';
37
Matteo Scandoloe57712f2016-09-21 15:27:36 -070038 $rootScope.$on('$stateChangeSuccess', (event, toState) => {
Arpit Agarwal43978742016-08-09 15:38:25 -070039 let strSelected = toState.url.split('/').join('');
40 this.active = strSelected.charAt(0).toUpperCase() + strSelected.slice(1);
41 });
42
43 this.config = {
44 actions: [
45 {
46 label: 'Form',
47 class: '',
48 link: '/#/form/'
49 },
50 {
51 label: 'Field',
52 class: '',
53 link: '/#/field/'
54
55 },
56 {
57 label: 'Alert',
58 class: '',
59 link: '/#/alert/'
60
61 },
62 {
63 label: 'Table',
64 class: '',
65 link: '/#/table/'
Matteo Scandoloe57712f2016-09-21 15:27:36 -070066 },
67 {
68 label: 'SmartTable',
69 class: '',
70 link: '/#/smartTable/'
Arpit Agarwal43978742016-08-09 15:38:25 -070071 }
72 ]
73 }
74 }
75 });
76
77})();