Matteo Scandolo | 8a64fa4 | 2016-01-21 11:21:03 -0800 | [diff] [blame^] | 1 | 'use strict'; |
| 2 | |
| 3 | angular.module('xos.serviceTopology', [ |
| 4 | 'ngResource', |
| 5 | 'ngCookies', |
| 6 | 'ngLodash', |
| 7 | 'ui.router', |
| 8 | 'xos.helpers' |
| 9 | ]) |
| 10 | .config(($stateProvider) => { |
| 11 | $stateProvider |
| 12 | .state('user-list', { |
| 13 | url: '/', |
| 14 | template: '<service-canvas></service-canvas>' |
| 15 | }); |
| 16 | }) |
| 17 | .config(function($httpProvider){ |
| 18 | $httpProvider.interceptors.push('NoHyperlinks'); |
| 19 | }) |
| 20 | .directive('usersList', function(){ |
| 21 | return { |
| 22 | restrict: 'E', |
| 23 | scope: {}, |
| 24 | bindToController: true, |
| 25 | controllerAs: 'vm', |
| 26 | templateUrl: 'templates/users-list.tpl.html', |
| 27 | controller: function(Services){ |
| 28 | // retrieving user list |
| 29 | Services.query().$promise |
| 30 | .then((res) => { |
| 31 | console.log(res); |
| 32 | }) |
| 33 | .catch((e) => { |
| 34 | throw new Error(e); |
| 35 | }); |
| 36 | } |
| 37 | }; |
| 38 | }); |