$scope.displayyears = [];
$scope.Joinyear = function(display) {
$scope.yeardisplay = display;
$scope.yeardisp = $scope.displayyears.push($scope.yeardisplay);
$scope.displayyearss = uniq($scope.yeardisp)
}
it throws error like "uniq is undefined"..How we check uniqueness??
Try checking if the yeardisplay is already in the array before you add it
$scope.displayyears = [];
$scope.Joinyear=function(display){
$scope.yeardisplay=display;
if ($scope.displayyears.indexOf(display) == -1) {
$scope.displayyears.push(display);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With