Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deletion on item Search #41

Closed
dud3 opened this issue Dec 8, 2014 · 0 comments
Closed

Deletion on item Search #41

dud3 opened this issue Dec 8, 2014 · 0 comments

Comments

@dud3
Copy link
Owner

dud3 commented Dec 8, 2014

For some strange reason, when filtering an item on ng-repeat (if one item found) the whole array becomes that "found item" and $rootScope.keyWordsLists.splice(index, 1); takes the index of 0, when actually it's not.

Write this instead:

$scope.deleteWish = function (id) {
    var index = $scope.keyWordsLists.indexOf(id);
    if (index != -1) {
        $scope.keyWordsLists.splice(index, 1);
    }
}

Basically index in this case doesnt help.

@besnik81
Any suggestions ?

References

@dud3 dud3 self-assigned this Dec 8, 2014
dud3 referenced this issue Dec 8, 2014
Resolves: #36
Releases: 1.2.13.6
@dud3 dud3 closed this as completed in 1d030e1 Dec 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant