2017-04-07 15:05:56 +02:00
|
|
|
angular.module('microStock', [
|
|
|
|
'angular-loading-bar',
|
|
|
|
'ngAnimate',
|
|
|
|
'ui.router'
|
|
|
|
])
|
|
|
|
.config(['$urlRouterProvider','$httpProvider',function($urlRouterProvider,$httpProvider){
|
|
|
|
$urlRouterProvider.otherwise('/');
|
|
|
|
$httpProvider.defaults.withCredentials = true;
|
|
|
|
}])
|
|
|
|
.config(['$stateProvider',function ($stateProvider) {
|
|
|
|
$stateProvider
|
|
|
|
.state('list', {
|
|
|
|
url: '/',
|
|
|
|
templateUrl: '/static/html/list.html',
|
|
|
|
controller: 'ListCtrl'
|
|
|
|
})
|
|
|
|
.state('item', {
|
|
|
|
url: '/product/:productid',
|
|
|
|
templateUrl: '/static/html/item.html',
|
|
|
|
controller: 'ItemCtrl'
|
|
|
|
})
|
2017-05-12 10:17:27 +02:00
|
|
|
.state('item-add', {
|
|
|
|
url: '/product/:productid/add',
|
|
|
|
templateUrl: '/static/html/item-add.html',
|
|
|
|
controller: 'ItemAddCtrl'
|
|
|
|
})
|
2017-04-07 15:05:56 +02:00
|
|
|
.state('statistics', {
|
|
|
|
url: '/statistics',
|
|
|
|
templateUrl: '/static/html/statistics.html',
|
|
|
|
controller: 'StatisticsCtrl'
|
|
|
|
});
|
2017-05-12 13:05:04 +02:00
|
|
|
}])
|
|
|
|
.filter('reloadSrc', function () {
|
|
|
|
return function (input) {
|
|
|
|
if (input)
|
|
|
|
return input + '?v=' + new Date().getTime();
|
|
|
|
}
|
|
|
|
});
|
2017-04-07 15:05:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
var config = {
|
|
|
|
'store': {
|
|
|
|
'status': '/api/status',
|
|
|
|
'goods': {
|
|
|
|
'productById': '/api/good/%d'
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'microservice_dependencies': {
|
|
|
|
'products': 'http://localhost:8080/api-test/product/',
|
|
|
|
'productById': 'http://localhost:8080/api-test/product/%d/'
|
|
|
|
}
|
|
|
|
};
|