Imagine I have the following:
$scope.listOfAttributes = ["someThings", "yetMoreThings"]
$scope.whatever = {
someThings: "stuff",
otherThings: "Also stuff",
yetMoreThings: "still stuff"
};
Can I achieve something like this:
<ul>
<li ng-repeat="thing in listOfAttributes">{{ whatever.thing }}</li>
</ul>
or do I need to preprocess it like so:
$scope.generatedObject = {}
$scope.listOfAttributes.forEach(function(thing)){
$scope.generatedObject[thing] = $scope.whatever[thing];
});