salix/modules/item/front/card/index.js

31 lines
612 B
JavaScript

import ngModule from '../module';
class Controller {
constructor($http, $stateParams) {
this.$http = $http;
this.$stateParams = $stateParams;
this.item = null;
}
$onInit() {
this.getCard();
}
getCard() {
this.$http.get(`/item/api/Items/${this.$stateParams.id}/getCard`).then(response => {
this.item = response.data;
});
}
reload() {
this.getCard();
}
}
Controller.$inject = ['$http', '$stateParams'];
ngModule.component('vnItemCard', {
template: require('./index.html'),
controller: Controller
});