Skip to content

Instantly share code, notes, and snippets.

@nhooyr
Created October 26, 2016 14:38
Show Gist options
  • Select an option

  • Save nhooyr/e8cf8102a8818c61af3fbc6c0b292da7 to your computer and use it in GitHub Desktop.

Select an option

Save nhooyr/e8cf8102a8818c61af3fbc6c0b292da7 to your computer and use it in GitHub Desktop.
// 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