34 lines
738 B
JavaScript
34 lines
738 B
JavaScript
import ngModule from '../module';
|
|
import Component from 'core/lib/component';
|
|
|
|
class Controller extends Component {
|
|
set user(value) {
|
|
this._user = value;
|
|
this.$.summary = null;
|
|
if (!value) return;
|
|
|
|
const filter = {
|
|
include: {
|
|
relation: 'role',
|
|
scope: {
|
|
fields: ['id', 'name']
|
|
}
|
|
}
|
|
};
|
|
this.$http.get(`Accounts/${value.id}`, {filter})
|
|
.then(res => this.$.summary = res.data);
|
|
}
|
|
|
|
get user() {
|
|
return this._user;
|
|
}
|
|
}
|
|
|
|
ngModule.component('vnUserSummary', {
|
|
template: require('./index.html'),
|
|
controller: Controller,
|
|
bindings: {
|
|
user: '<'
|
|
}
|
|
});
|