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

27 lines
545 B
JavaScript
Raw Normal View History

2017-12-20 13:36:12 +00:00
import ngModule from '../module';
class Controller {
constructor($http, $state) {
2017-12-21 13:09:55 +00:00
this.$http = $http;
this.$state = $state;
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
_getCard() {
this.$http.get(`/item/api/Items/${this.$state.params.id}/getCard`).then(response => {
this.item = response.data;
});
}
$onInit() {
this._getCard();
}
2017-12-20 13:36:12 +00:00
}
Controller.$inject = ['$http', '$state'];
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
});