I am developing a simple program (in concept) but unfortunately. I have com upon the problem and days of googling have not resulted in anything.
I'm trying to loop through an object, and all it's children. I've done this with two ng-repeat
s which in theory seems pretty sound and fool-proof
Here's my current code:
(function() {
var CHEAT = angular.module('cheat', []);
CHEAT.controller('maps', function($scope) {
$scope.search = "";
$scope.range = {
"Globals": {
"$": "M",
"M": {
"z": "q"
}
},
"Other": {
"S": {
'c': "cat"
}
}
};
$scope.type = function(obj) {
return typeof obj;
};
});
}());
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div id="info" ng-app="cheat" ng-controller="maps">
<div ng-repeat="(res, prop) in range">
{{prop}} =
<div ng-repeat="(key,test) in prop">
{{key}}: {{test}}
</div>
</div>
</div>
See Question&Answers more detail:os