In my application we use Restangular and $http to communicate with server API.
First request (the one /BasicInfo.json on the picture) is done using Restangular for retrieving initial information, like user name, and also Number pointer to part of the of the app is used (appId). Other requests use this data for further calls, they are done just with using regular $http service.
But in IE9 specifically (not >=IE10, I also have html5shiv) I get the resolved response as a string of chars, like this:
[123,23,45,98,143,...]
That is why first piece of data is not processed properly and other calls cannot resolve - see "undefined" in the URL in the picture. Second and subsequent call use following patters for forming the URL.
//baseURL and docId - are available, while appId is not
$http.get(baseURL + '/api/' + appId + '/Subjects/' + docId + '.json')
.success(function(data){ deferred.resolve(data);
..
This line is actually a list of Chars containing correct server response, but in such a weird way. I've found the way to convert it using function like this:
//numbersLine is that actual line [123,23,45,98,143,...]
var str = '',
convertedArray = Array(numbersLine)[0];
for (var i = 0; i < convertedArray.length; i++) {
str = str + String.fromCharCode(convertedArray[i]);
}
return str;
But I have to do this conversion everywhere in the app where I deal with API data, because of this IE9 strange behaviour. Any advice about what I could check/change would be very appreciated.
[UPD]
This is module setup
define([
'angular',
'./modulename',
'app/base/base-module',
//module definition via RequireJS
angular.module('app.modulename').config(
['$stateProvider', '$BasicProvider',
function ($stateProvider, $BasicProvider) {
$stateProvider.state('***', {
url: '***',
views : {
///
},
resolve : {
//here should get POJO with appid
resolvedBasicInfo : ["$Basic", function($Basic){
return $Basic.getBasicInfo();
}],
//later goest two other calls that require this appid
And Base module itself has Restangular call
define([
'angular',
'restangular',
//other configs
], function( angular, Restangular ) {
'use strict';
return angular.module('effactsApp.base').provider('$Basic', function(){
return {
$get : ['Restangular', 'baseApiService', //other configs
function (Restangular, baseApiService) {
//
if(!basicInfoRestCall){
basicInfoRestCall = Restangular.one('BasicInfo');
}
@dhavalcengg, hope it gives the idea