salix/client/item/src/summary/index.js

29 lines
578 B
JavaScript
Raw Normal View History

2018-02-20 11:33:17 +00:00
import ngModule from '../module';
class Controller {
2018-02-20 11:33:17 +00:00
constructor($http) {
this.$http = $http;
}
getSummary() {
this.$http.get(`/item/api/Items/${this.item.id}/getSummary`).then(response => {
this.summary = response.data;
2018-02-20 11:33:17 +00:00
});
}
$onChanges() {
if (this.item && this.item.id)
this.getSummary();
2018-02-20 11:33:17 +00:00
}
}
Controller.$inject = ['$http', '$stateParams'];
2018-02-20 11:33:17 +00:00
ngModule.component('vnItemSummary', {
template: require('./index.html'),
controller: Controller,
2018-02-20 11:33:17 +00:00
bindings: {
item: '<'
}
});