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

32 lines
613 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
});