salix/client/item/src/data/item-data.js

25 lines
533 B
JavaScript
Raw Normal View History

2017-12-21 13:09:55 +00:00
import ngModule from '../module';
2018-02-20 13:30:02 +00:00
class ItemData {
constructor($scope, $timeout) {
this.$scope = $scope;
this.$timeout = $timeout;
}
$onChanges(data) {
if (!this.$scope.watcher)
this.$timeout(() => {
this.$scope.watcher.data = data.item.currentValue;
});
}
}
ItemData.$inject = ['$scope', '$timeout'];
2017-12-21 13:09:55 +00:00
ngModule.component('vnItemData', {
template: require('./item-data.html'),
bindings: {
item: '<'
2018-02-20 13:30:02 +00:00
},
controller: ItemData
2017-12-21 13:09:55 +00:00
});