Do you know how to use dynamic/chained variables inside a controller variable definition?
I have created this plnkr to further outline what I am trying to achieve: http://plnkr.co/edit/xOjhf8b7ZIxVhc1Id3xo
In the NodeCtrl, I am trying to dynamically access a node from a json object and I can't find the correct syntax to write out the chain.
I have tried a number of combinations but haven't found the correct way yet:
//var jsonChunk = "data." + $scope.transcendType;
$scope.tabinventory = data.$scope.transcendType;
//data;
//jsonChunk;
//function() { return "data." + $scope.transcendType; };
alert($tabinventory[0].title)
//alert($scope.tabinventory.project[0].title);
Any help you could provide would be greatly appreciated.
All the best,
Ben