Skip to content

Instantly share code, notes, and snippets.

@morsdyce
Created June 5, 2013 20:45
Show Gist options
  • Save morsdyce/5717178 to your computer and use it in GitHub Desktop.
Save morsdyce/5717178 to your computer and use it in GitHub Desktop.
Usage of requestHandler #gisto #angular #website_embed
'use strict';
function exampleController($scope, requestHandler) {
// notifications are enabled by default, if you do not wish the notification
// to show provide the stopNotification property with the value true
requestHandler({
method: 'GET',
url: 'http://localhost/api/gist/1',
// stopNotification: true // will stop the notification from being displayed.
}).success(function(data, status, headers, config) {
console.log(data, status, headers, config);
}).error(function(data, status, headers, config) {
console.log(data, status, headers, config);
});
/*
* You may also use the shortcut methods such as:
* requestHandler.get, requestHandler.post, requestHandler.put,
* requestHandler.delete, requestHandler.head, requestHandler.jsonp
*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment