Arpit Agarwal | 4397874 | 2016-08-09 15:38:25 -0700 | [diff] [blame] | 1 | /* eslint-disable angular/ng_module_name */ |
| 2 | (function(){ |
| 3 | 'use strict'; |
Arpit Agarwal | 4397874 | 2016-08-09 15:38:25 -0700 | [diff] [blame] | 4 | angular.module('ngXosLib', ['xos.helpers', 'ui.router']) |
Arpit Agarwal | 4397874 | 2016-08-09 15:38:25 -0700 | [diff] [blame] | 5 | .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 Scandolo | e57712f | 2016-09-21 15:27:36 -0700 | [diff] [blame] | 23 | .state('smart-table-test', { |
| 24 | url: '/smartTable/', |
| 25 | template: '<smart-table-test></smart-table-test>' |
| 26 | }) |
Arpit Agarwal | 4397874 | 2016-08-09 15:38:25 -0700 | [diff] [blame] | 27 | }) |
| 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 Scandolo | e57712f | 2016-09-21 15:27:36 -0700 | [diff] [blame] | 38 | $rootScope.$on('$stateChangeSuccess', (event, toState) => { |
Arpit Agarwal | 4397874 | 2016-08-09 15:38:25 -0700 | [diff] [blame] | 39 | 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 Scandolo | e57712f | 2016-09-21 15:27:36 -0700 | [diff] [blame] | 66 | }, |
| 67 | { |
| 68 | label: 'SmartTable', |
| 69 | class: '', |
| 70 | link: '/#/smartTable/' |
Arpit Agarwal | 4397874 | 2016-08-09 15:38:25 -0700 | [diff] [blame] | 71 | } |
| 72 | ] |
| 73 | } |
| 74 | } |
| 75 | }); |
| 76 | |
| 77 | })(); |