javascript - angular.identity is undefined -
i'm trying use following...
.withhttpconfig({transformrequest: angular.identity})
but undefined not function not seems know angular.identity
is. can help?
full code:
angular.module('app.controllers.project', [ "app.factories.storage", "app.factories.http", "app.directives.typeahead", "app.directives.projectdisplay", "toaster" ]) .controller("projectcontroller", ['$scope', '$rootscope', "$location", "httpfactory", "filterservice", "$stateparams", "toaster", function ($scope, $rootscope, $location, httpfactory, filterservice, $stateparams, toaster) { var createproject = function () { var resource = httpfactory .withhttpconfig({transformrequest: angular.identity}) .post("project", data, {}, {'content-type': undefined}) .then(function () { // on success console.log("done") }, function () { // on failure console.log("error") }); etc
angular.identiy
simple function returns arguments.
here source code of it: https://github.com/angular/angular.js/blob/master/src/angular.js#l379
what happens if change code from
.withhttpconfig({transformrequest: angular.identity})
to
.withhttpconfig({transformrequest: function(arg) { return arg; } })
Comments
Post a Comment