36 lines
625 B
JavaScript
36 lines
625 B
JavaScript
|
import ngModule from '../../module';
|
||
|
|
||
|
class Controller {
|
||
|
constructor($http) {
|
||
|
this.$http = $http;
|
||
|
}
|
||
|
|
||
|
get zone() {
|
||
|
return this._zone;
|
||
|
}
|
||
|
|
||
|
set zone(value) {
|
||
|
this._zone = value;
|
||
|
|
||
|
if (!value) return;
|
||
|
|
||
|
this.getSummary();
|
||
|
}
|
||
|
|
||
|
getSummary() {
|
||
|
this.$http.get(`/agency/api/Zones/${this.zone.id}`).then(response => {
|
||
|
this.summary = response.data;
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Controller.$inject = ['$http'];
|
||
|
|
||
|
ngModule.component('vnZoneSummary', {
|
||
|
template: require('./index.html'),
|
||
|
controller: Controller,
|
||
|
bindings: {
|
||
|
zone: '<'
|
||
|
}
|
||
|
});
|