course details changes done
This commit is contained in:
parent
1467ce3caf
commit
40f69f2d63
@ -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;
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user