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

34 lines
738 B
JavaScript
Raw Normal View History

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: '<'
}
});