Last active
August 29, 2015 13:59
-
-
Save MichalBryxi/10741698 to your computer and use it in GitHub Desktop.
ic.ajax problem
This file contains 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
// This works: | |
return ic.ajax(url).then(function (response) {}); | |
// This throws following error: | |
return ic.ajax.request({ | |
type: "PUT", | |
url: url | |
}).then(function (response) {}); | |
// TypeError: undefined is not a function | |
// And this is interesting: | |
console.log('ic:'); | |
console.log(ic); | |
console.log('ic.ajax:'); | |
console.log(ic.ajax); | |
console.log('ic.ajax.request():'); | |
console.log(ic.ajax.request()); | |
// ic: | |
// Object {ajax: function} | |
// ic.ajax: | |
// function ajax(){return ajax.raw.apply(null,arguments).then(function(result){return result.response},null,"ic-ajax: unwrap raw ajax response")} | |
// ic.ajax.request(): | |
// TypeError: undefined is not a function | |
// Finally resolved by using .raw() | |
return ic.ajax.raw({ | |
type: "PUT", | |
url: url | |
}).then(function (response) {}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I assume url is defined... stupid question I know...