One of the challenges I am facing is removing items from an array with the same key value of skillId when a button in the repeat is clicked. Here's the code snippet I have worked on:
$scope.deleteSkill = function(skill) {
for (var i=0; i<$scope.pathArray.length; i++){
if($scope.pathArray[i].skillId == skill){
$scope.pathArray.splice(i,1);
}
};
};
The deletion process occurs within a repeat loop where the "skill" passed represents its skillId and is functioning as intended. My attempt involves iterating through the scope's array and eliminating any item with a matching skillId. However, upon testing my logic, it appears that only one item is removed even if there are multiple matches. Any insights or assistance would be greatly appreciated. Thank you!