Created
October 26, 2016 14:38
-
-
Save nhooyr/e8cf8102a8818c61af3fbc6c0b292da7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // get list of announcements | |
| $http.get("https://radiograydon.aubble.com/announcements").then(function(response) { | |
| $scope.announcements = response.data | |
| console.log("success") | |
| // delete all announcements | |
| for (var i = 0; i < response.data.length; i++) { | |
| $http.delete("https://radiograydon.aubble.com/announcements/" + response.data[i].id, { | |
| headers: { | |
| Authorization: "Basic b21hcjp4eER4eER4eA==" | |
| } | |
| }).then(function(response) { | |
| console.log("success") | |
| }, function(response) { | |
| console.log(response) | |
| }) | |
| } | |
| }, function(response) { | |
| console.log(response) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment