Created
November 4, 2013 19:27
-
-
Save karptonite/7307862 to your computer and use it in GitHub Desktop.
Restangular issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Click a delete button. Get the confirm dialog box. Click yes. | |
Console logs "deleting [id]" and "done". | |
If I click delete again, or anything else, THEN the Restangular remove fires and sends the delete request. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$scope.delete = function( id ){ | |
StickyWin.confirm( "Confirm", "Are you sure you want to delete this contest?", function(){ | |
console.log( 'deleting' + id ); | |
Restangular.one( 'contests', id ).remove().then(function(){ | |
console.log( 'deleted' ); | |
Restangular.all( "contests" ).getList().then( function( response ){ | |
console.log( 'resetting'); | |
$scope.contests = response; | |
}); | |
}); | |
console.log('done'); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment