@@ -20,7 +20,7 @@ Angular2-Token is currently in Alpha. Any contribution is much appreciated.
2020 - [ ` .validateToken() ` ] ( #validatetoken )
2121 - [ ` .updatePassword() ` ] ( #updatepassword )
2222- [ HTTP Service Wrapper] ( #http-service-wrapper )
23- - [ Multiple User types ] ( #multiple-user-types )
23+ - [ Multiple User Types ] ( #multiple-user-types )
2424- [ Testing] ( #testing )
2525- [ Credits] ( #credits )
2626- [ License] ( #license )
@@ -31,21 +31,19 @@ Angular2-Token is currently in Alpha. Any contribution is much appreciated.
3131 npm install angular2-token --save
3232 ```
3333
34- 2. Import ` Angular2TokenService` into your component
34+ 2. Import and add ` Angular2TokenService` to your module.
3535 ` ` ` javascript
3636 import { Angular2TokenService } from ' angular2-token' ;
37- ` ` `
3837
39- 3. Add ` Angular2TokenService` as a provider to your component
40- ` ` ` javascript
41- @Component({
42- selector: ' app' ,
43- providers: [Angular2TokenService],
44- templateUrl: ' ./app.html' ,
38+ @NgModule({
39+ imports: [ BrowserModule ],
40+ declarations: [ AppComponent ],
41+ providers: [ Angular2TokenService ],
42+ bootstrap: [ AppComponent ]
4543 })
4644 ` ` `
4745
48- 4 . Inject ` Angular2TokenService` into your component and call ` .init()`
46+ 3 . Inject ` Angular2TokenService` into your component and call ` .init()`
4947 ` ` ` javascript
5048 constructor(private _tokenService: Angular2TokenService) {
5149 this._tokenService.init ();
@@ -198,9 +196,9 @@ The user type is selected during sign in and persists until sign out.
198196` ` ` javascript
199197this._tokenService.init({
200198 userTypes: [
201- { name: ' ADMIN' , path: ' admin' },
202- { name: ' USER' , path: ' user' )
203- } ]
199+ { name: ' ADMIN' , path: ' admin' },
200+ { name: ' USER' , path: ' user' }
201+ ]
204202});
205203
206204this._tokenService.signIn(
0 commit comments