bansho/app/components/directive/hostTree/hostTree.js

24 lines
859 B
JavaScript

'use strict';
angular.module('bansho.hostTree', ['bansho.datasource'])
.directive('banshoHostTree', function () {
return {
restrict: 'E',
scope: {
options: '='
},
templateUrl: 'components/directive/hostTree/hostTree.html',
controller: ['$scope', 'sharedData',
function ($scope, sharedData) {
$scope.sources = {};
angular.forEach($scope.options.attributes.inputSource, function (source) {
$scope.sources[source] = sharedData.getDataFromInputSource(source, function (data) {
$scope.sources[source] = data;
});
});
$scope.components = $scope.options.components;
}]
};
});