Reputation: 584
<a on-swipe="onSwipe()" href="#/app/setting/{{book.id}}" ng-repeat="data in savedData">
I got my $scope.savedData from localstorage, how can I get {{book.id}} to know which item the user actually want to delete?
$scope.onSwipe = function () {
//I need to get {{book.id}} here
};
bind it to a new ng-model?
Upvotes: 0
Views: 26
Reputation: 104795
Pass it as a parameter:
<a on-swipe="onSwipe(book.id)" href="#/app/setting/{{book.id}}" ng-repeat="data in savedData">
$scope.onSwipe = function (id) {
//id == book.id
};
Upvotes: 1