course details changes done

This commit is contained in:
gandhimathi 2018-01-11 18:30:03 +05:30
parent 1467ce3caf
commit 40f69f2d63

View File

@ -95,4 +95,22 @@ app.controller('ModalInstanceCtrl', ["$scope", "$modalInstance", "items","WordsS
}]);
app.filter('unique', function() {
return function(collection, primaryKey, secondaryKey) { //optional secondary key
var output = [],
keys = [];
angular.forEach(collection, function(item) {
var key;
secondaryKey === undefined ? key = item[primaryKey] : key = item[primaryKey][secondaryKey];
if(keys.indexOf(key) === -1) {
keys.push(key);
output.push(item);
}
});
return output;
};
});