I have similar applications. I am adding a token (previously obtained after authentication) using this:
Generic ajax call using jQuery:
$.ajax({ beforeSend: function (request) { request.setRequestHeader("Authority", authorizationToken); },
Here using Cordova + Ionic + Angularjs:
$http.defaults.headers.common.Authorization = authorizationToken; if ($http.defaults.headers.common.Authorization.Parameter != undefined) { $http.defaults.headers.common.Authorization.Parameter = authorizationToken; }
Hope this helps.
source share