I use node to get a list of our Swimlanes (like an array of JSON objects) for an internal database tool.
Format:
swimlanes = [{"swimlane" : "1"},{"swimlane" : "2"}, ...]
Then I retrieve a list of all instances of MSSQL Server (in the same format).
instances = [{"instance" : "host\instance", "swimlane" : "1"}, ...]
What I want to do is create a JSON object with a name like slInstances, which will be a collection of instance arrays using swimlane.
slInstances = { "1" : ["host\instance", "host\instance"], "2" : ["host\instance", "host\instance"]
I tried:
function getInstancesSuccess(response){
$scope.instances = response.data;
$scope.slInstances = {};
$scope.swimlanes.forEach(function(){
var sl = this.swimlane;
$scope.slInstances[sl] = $scope.instances.filter(function(el){
return el.swimlane == sl;
})
});
}
(only keeping the "instances" in scope, because I will use it for something else) But that doesn't work at all. My hope was to have sl = something like "1", making my way through each fin. And thus, assign the value for slInstances ["1"] =, slInstances ["2"] = ....
angular - :
<ul>
<li ng-repeat="sl in swimlanes">{{sl['swimlane']}}
<ul>
<li ng-repeat="i in slInstances">{{ i[sl['swimlane']].instance}}
, , , (0,1,22,23,30,31 ..). , .
?
!
EDIT:
, :
http://plnkr.co/edit/Y2PjAxzsvm201EL7mQC4