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

32 lines
613 B
JavaScript
Raw Normal View History

2017-12-20 13:36:12 +00:00
import ngModule from '../module';
class Controller {
constructor($http, $stateParams) {
2017-12-21 13:09:55 +00:00
this.$http = $http;
this.$stateParams = $stateParams;
2018-02-20 13:30:02 +00:00
this.item = null;
2017-12-20 13:36:12 +00:00
}
2017-12-21 13:09:55 +00:00
$onInit() {
this.getCard();
}
getCard() {
this.$http.get(`/item/api/Items/${this.$stateParams.id}/getCard`).then(response => {
this.item = response.data;
});
}
reload() {
this.getCard();
}
2017-12-20 13:36:12 +00:00
}
Controller.$inject = ['$http', '$stateParams'];
2017-12-20 13:36:12 +00:00
ngModule.component('vnItemCard', {
template: require('./index.html'),
controller: Controller
2017-12-20 13:36:12 +00:00
});