User Service
ALPHA We are still working on this. May not work! When this is gone its working! ;-)
Used as Provider in app.module.ts. Note the UserService in the Providers declaration.
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
],
providers: [UserService],
bootstrap: [AppComponent]
})
export class AppModule { }
Acknowledgements
Most of this code was written by Keith Dechant taken from here. I just added a few bits that were useful to me.
https://www.metaltoad.com/blog/angular-api-calls-django-authentication-jwt