I need help with displaying only the items listed in defaults and excluding the others.
<ul ng-controller="Ctrl" class="dropdown-menu">
<li ng-repeat="(key, value) in Employee.KeyValue | filter:DefaultKeys(key) ">{{key}}</li>
</ul>
angular.module('app', []);
function Ctrl($scope) {
$scope.DefaultKeys = function(item) {
var defaultItems = ["SSS No.", "TIN"];
return defaultItems.indexOf(item);
};
$scope.Employee =
{
Code: '123',
KeyValue:
{
'TIN': '9038468',
'Facebook' : 'https://fb.com/abc'
}
}
}
Here is the fiddle for reference.
Any assistance would be greatly appreciated.