Last active
December 27, 2015 22:09
-
-
Save dev0x10/7397393 to your computer and use it in GitHub Desktop.
Enable CORS in AngularJS
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
| var app = angular.module("appname", []); | |
| app.config(function($httpProvider) { | |
| //Enable cross domain calls | |
| $httpProvider.defaults.useXDomain = true; | |
| //Remove the header used to identify ajax call that would prevent CORS from working | |
| delete $httpProvider.defaults.headers.common['X-Requested-With']; | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment