2017-12-20 13:36:12 +00:00
|
|
|
import ngModule from '../module';
|
|
|
|
|
2018-05-25 08:03:45 +00:00
|
|
|
class Controller {
|
2018-09-14 11:43:51 +00:00
|
|
|
constructor($http, $stateParams) {
|
2017-12-21 13:09:55 +00:00
|
|
|
this.$http = $http;
|
2018-09-14 11:43:51 +00:00
|
|
|
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
|
|
|
|
2018-09-14 11:43:51 +00:00
|
|
|
$onInit() {
|
|
|
|
this.getCard();
|
|
|
|
}
|
|
|
|
|
|
|
|
getCard() {
|
|
|
|
this.$http.get(`/item/api/Items/${this.$stateParams.id}/getCard`).then(response => {
|
2018-08-08 12:40:01 +00:00
|
|
|
this.item = response.data;
|
2018-03-02 09:51:01 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-09-14 11:43:51 +00:00
|
|
|
reload() {
|
|
|
|
this.getCard();
|
2018-03-02 09:51:01 +00:00
|
|
|
}
|
2017-12-20 13:36:12 +00:00
|
|
|
}
|
2018-05-25 08:03:45 +00:00
|
|
|
|
2018-09-14 11:43:51 +00:00
|
|
|
Controller.$inject = ['$http', '$stateParams'];
|
2017-12-20 13:36:12 +00:00
|
|
|
|
|
|
|
ngModule.component('vnItemCard', {
|
2018-05-25 08:03:45 +00:00
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
2017-12-20 13:36:12 +00:00
|
|
|
});
|