I'm Trying to notify the user each time a duplicate is registered in a table. I would like to catch the: Error: [ngRepeat:dupes] and alert the user before proceeding. Here is the controller method adding elements to the table:
$scope.addProdukt = function (item) { kladdValidationService.checkTable(); try { $scope.addedResult.push(item); // works fine logService.info('Produktet er lagt til i tabellen'); } catch (e) { console.log(e.stack); console.log($exceptionHandler(e)); // neither of these two work } console.log($scope.addedResult); }; Every time I push an already added item to the table, the Error: [ngRepeat:dupes] outputs in the console. Juswt not sure how to catch it.