Error: Cannot read property 'getCookie' of null when making http requests

I get this error Cannot read property 'getCookie' of null, whenever i try to make an http request. I was initially informed it could be due to using an old version of nativescript. I have updated all i can update and still have the same issue. (versions: nativescript-angular: 1.0.0, angular/http: 2.0.0)

This question looks similar but it doesn't seem to have any ties with nativescript and i couldn't really understand the only given answer. Thanks in advance.


ANSWERS:


Importing NativeScriptHttpModule should do the job. Here is the code snippet.

import {NativeScriptHttpModule} from "nativescript-angular/http";

@NgModule({
.....
providers: [NativeScriptHttpModule]
.....
})

if you have newest versions, quite possible that problem is same as here

In short: Try change all "HTTP_PROVIDERS" to "NS_HTTP_PROVIDERS"



 MORE:


 ? toggleDrawerState with Nativescript-telerik-ui slide drawer
 ? toggleDrawerState with Nativescript-telerik-ui slide drawer
 ? toggleDrawerState with Nativescript-telerik-ui slide drawer
 ? Nativescript: Controlling sideDrawer logically
 ? i have use two dropdown components in single page but only first of them is showing data not second one in nativescript ios
 ? NativeScript/Angular - Reactive form not working
 ? NativeScript ANDROID_HOME missing
 ? Developing Nativescript app with Local API
 ? TypeError: Cannot read property 'libelle' of undefined
 ? NativeScript TAB button double functionalaty