Created
June 29, 2014 15:27
-
-
Save jstroem/a3d3efdbe53b717d9edf to your computer and use it in GitHub Desktop.
Angular.js with PHP backend
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
app.config(['$httpProvider', | |
function($httpProvider) { | |
// Use x-www-form-urlencoded Content-Type | |
$httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8'; | |
// Override $http service's default transformRequest | |
$httpProvider.defaults.transformRequest = [function(data) { | |
return angular.isObject(data) && String(data) !== '[object File]' ? $.param(data) : data; | |
}]; | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment