diff --git a/README.md b/README.md index f14becd9..681ec3c5 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ [![npm version](https://badge.fury.io/js/%40auth0%2Fangular-jwt.svg)](https://badge.fury.io/js/%40auth0%2Fangular-jwt) -### **NOTE:** This library is now at version 3 and is published on npm as `@auth0/angular-jwt`. If you're looking for the pre-v1.0 version of this library, it can be found in the `pre-v1.0` branch and on npm as `angular2-jwt`. +### **NOTE:** This library is now at version 4 and is published on npm as `@auth0/angular-jwt`. If you're looking for the pre-v1.0 version of this library, it can be found in the `pre-v1.0` branch and on npm as `angular2-jwt`. -**@auth0/angular-jwt v3 is to be used with Angular v6+ and RxJS v6+. For Angular v4.3 to v5+, use @auth0/angular-jwt v1** +**@auth0/angular-jwt v4 is to be used with Angular v6+ and RxJS v6+. For Angular v4.3 to v5+, use @auth0/angular-jwt v1** This library provides an `HttpInterceptor` which automatically attaches a [JSON Web Token](https://jwt.io) to `HttpClient` requests. @@ -78,9 +78,10 @@ export class AppComponent { constructor(public http: HttpClient) {} ping() { - this.http - .get("http://example.com/api/things") - .subscribe(data => console.log(data), err => console.log(err)); + this.http.get("http://example.com/api/things").subscribe( + data => console.log(data), + err => console.log(err) + ); } } ``` diff --git a/package.json b/package.json index 0d005361..3ee1d1d4 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "angular2-jwt", + "name": "@auth0/angular-jwt", "version": "4.0.0", "scripts": { "ng": "ng", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 021a116a..d524aa84 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,18 +1,15 @@ -import { BrowserModule } from '@angular/platform-browser'; -import { NgModule } from '@angular/core'; -import { AppComponent } from './app.component'; -import {JwtModule} from 'angular-jwt'; -import {HttpClientModule} from '@angular/common/http'; +import { BrowserModule } from "@angular/platform-browser"; +import { NgModule } from "@angular/core"; +import { AppComponent } from "./app.component"; +import { JwtModule } from "angular-jwt"; +import { HttpClientModule } from "@angular/common/http"; export function tokenGetter() { - return 'SOME_TOKEN'; + return "SOME_TOKEN"; } - @NgModule({ - declarations: [ - AppComponent - ], + declarations: [AppComponent], imports: [ BrowserModule, HttpClientModule, @@ -25,4 +22,4 @@ export function tokenGetter() { providers: [], bootstrap: [AppComponent] }) -export class AppModule { } +export class AppModule {}