salix/modules/entry/front/summary/index.js

38 lines
860 B
JavaScript
Raw Normal View History

2020-02-04 08:34:31 +00:00
import ngModule from '../module';
import './style.scss';
import Component from 'core/lib/component';
class Controller extends Component {
constructor($element, $, $httpParamSerializer) {
super($element, $);
this.$httpParamSerializer = $httpParamSerializer;
}
get entry() {
return this._entry;
}
set entry(value) {
this._entry = value;
2020-02-21 11:48:34 +00:00
if (value && value.id)
2020-02-25 09:39:21 +00:00
this.getEntryData();
2020-02-04 08:34:31 +00:00
}
2020-02-25 09:39:21 +00:00
getEntryData() {
2020-02-21 11:48:34 +00:00
return this.$http.get(`/api/Entries/${this.entry.id}/getEntry`).then(response => {
this.entryData = response.data;
});
}
2020-02-04 08:34:31 +00:00
}
Controller.$inject = ['$element', '$scope', '$httpParamSerializer'];
ngModule.component('vnEntrySummary', {
template: require('./index.html'),
controller: Controller,
bindings: {
entry: '<'
}
});