salix/modules/account/front/role/summary/index.js

26 lines
535 B
JavaScript
Raw Normal View History

import ngModule from '../../module';
import Component from 'core/lib/component';
class Controller extends Component {
set role(value) {
this._role = value;
this.$.summary = null;
if (!value) return;
this.$http.get(`Roles/${value.id}`)
.then(res => this.$.summary = res.data);
}
get role() {
return this._role;
}
}
ngModule.component('vnRoleSummary', {
template: require('./index.html'),
controller: Controller,
bindings: {
role: '<'
}
});