genofire/hs_monolith
genofire
/
hs_monolith
Archived
1
0
Fork 0
This repository has been archived on 2020-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
hs_monolith/webroot/static/js/item.controller.js

23 lines
704 B
JavaScript

'use strict';
angular.module('microStock')
.controller('ItemCtrl',['$scope','$http','$stateParams',function($scope,$http,$stateParams){
$scope.obj = {};
$scope.list = [];
function load(){
$http.get(config.microservice_dependencies.productById.replace("%d", $stateParams.productid)).then(function(res) {
$scope.obj = res.data
});
$http.get(config.store.goods.productById.replace("%d",$stateParams.productid)).then(function(res) {
$scope.list = res.data;
},function(){
$scope.list = [];
});
}
load();
$scope.delete = function(id){
$http.delete(config.store.goods.productById.replace("%d",id)).then(load);
}
}]);