blob: 185f09b1a65d9d0a8e003d5ca069ba6d9d63b02e [file] [log] [blame]
'use strict';
angular.module('xos.sampleView', [
'ngResource',
'ngCookies',
'ngLodash',
'ui.router',
'xos.helpers'
])
.config(($stateProvider) => {
$stateProvider
.state('user-list', {
url: '/',
template: '<users-list></users-list>'
});
})
.config(function($httpProvider){
$httpProvider.interceptors.push('NoHyperlinks');
})
.directive('usersList', function(){
return {
restrict: 'E',
scope: {},
bindToController: true,
controllerAs: 'vm',
templateUrl: 'templates/users-list.tpl.html',
controller: function($http){
// retrieving user list
$http.get('/api/core/users')
.then((users) => {
this.users = users;
})
.catch((e) => {
throw new Error(e);
});
}
};
});