salix/front/core/components/data-viewer/index.js

34 lines
678 B
JavaScript
Raw Normal View History

2019-10-02 17:24:42 +00:00
import ngModule from '../../module';
import './style.scss';
export default class DataViewer {
get isReady() {
return this.status == 'ready';
2019-10-02 17:24:42 +00:00
}
get status() {
if (this.model)
return this.model.status;
if (this.isLoading)
2019-10-02 17:24:42 +00:00
return 'loading';
if (!this.data)
2019-10-02 17:24:42 +00:00
return 'clear';
if (this.data.length)
return 'ready';
else
return 'empty';
2019-10-02 17:24:42 +00:00
}
}
ngModule.component('vnDataViewer', {
template: require('./index.html'),
transclude: true,
controller: DataViewer,
bindings: {
model: '<?',
data: '<?',
isLoading: '<?'
}
});