Empty AngularJS 1.4.8
Empy fiddle for AngularJS
HTML
<div ng-app="myApp">
<div ng-controller="MyCtrl">
<div ng-repeat="user in users">
<div ng-repeat="p in properties">
{{getUserProperty(user, p.displayValue)}}
</div>
</div>
</div>
</div>
JavaScript
var myApp = angular.module('myApp', []);
myApp.controller('MyCtrl', ['$scope', function($scope) {
$scope.properties = [{
propertyID: 1,
displayValue: 'Name'
}, {
propertyID: 3,
displayValue: 'DOB'
}, {
propertyID: 5,
displayValue: 'Address'
}];
$scope.users = [{
Name: 'User1',
Test: 'Shouldnt be shown',
DOB: 'DOB',
Address: 'Address of User1'
}, {
Name: 'User2',
Test: 'Shouldnt be shown',
DOB: 'DOB',
Address: 'Address of User2'
}];
$scope.getUserProperty = function(user, property) {
return user[property];
}
}]);