i am new to breeze and odata..
im trying to fetch data from odata api using breeze in angular...
heres my code:
//adding authorization to the header
var authObj = localStorageService.get('authorizationData');
var token = 'Bearer ' + authObj.token;
var oldClient = OData.defaultHttpClient;
var myClient = {
request: function (request, success, error) {
request.headers.Authorization = token;
return oldClient.request(request, success, error);
}
};
OData.defaultHttpClient = myClient;
baseService.getBreezeAdapter;
breeze.NamingConvention.camelCase.setAsDefault();
var manager = baseService.newManager();
var query = new breeze.EntityQuery()
.from('Customers');
function fetchData() {
manager.executeQuery(query)
.then(function (data) {
console.log(data)
})
.catch(function (fail) {
console.log(fail)
})
.finally(function (response) {
});
};
when i look into fiddler.. there was no error..its working fine..
but after the query it falls down to catch which is fail.. it returns an error message "; ", but it said that the statustext is ok and it has the data in its body element..
here is the actual error
{message: "; ", statusText: "OK", status: 200, url: "http://xxxxxx.net/odata/Customers", body: Object…}
can someone can explain to me why its returning an error ";"