@@ -42,8 +42,8 @@ A sample application can be found [here](https://github.com/neroniaky/angular2-t
4242
43433. Inject ` Angular2TokenService` into your main component and call ` .init()` .
4444 ` ` ` javascript
45- constructor(private _tokenService : Angular2TokenService) {
46- this._tokenService .init ();
45+ constructor(tokenService : Angular2TokenService) {
46+ this.tokenService .init ();
4747 }
4848 ` ` `
4949
@@ -114,8 +114,8 @@ Configuration options can be passed as `Angular2TokenOptions` via `.init()`.
114114
115115# ## Default Configuration
116116` ` ` javascript
117- constructor(private _tokenService : Angular2TokenService) {
118- this._tokenService .init({
117+ constructor(private tokenService : Angular2TokenService) {
118+ this.tokenService .init({
119119 apiBase: null,
120120 apiPath: null,
121121
@@ -197,7 +197,7 @@ The optional parameter `type` specifies the name of UserType used for this sessi
197197
198198# ### Example:
199199` ` ` javascript
200- this._tokenService .signIn({
200+ this.tokenService .signIn({
201201202202 password: ' secretPassword'
203203}).subscribe(
@@ -213,7 +213,7 @@ The signOut method destroys session and session storage.
213213
214214# ### Example:
215215` ` ` javascript
216- this._tokenService .signOut ().subscribe(
216+ this.tokenService .signOut ().subscribe(
217217 res => console.log(res),
218218 error => console.log(error)
219219);
@@ -226,7 +226,7 @@ Sends a new user registration request to the Server.
226226
227227# ### Example:
228228` ` ` javascript
229- this._tokenService .registerAccount({
229+ this.tokenService .registerAccount({
230230231231 password: ' secretPassword' ,
232232 passwordConfirmation: ' secretPassword'
@@ -243,7 +243,7 @@ Deletes the account for the signed in user.
243243
244244# ### Example:
245245` ` ` javascript
246- this._tokenService .deleteAccount ().subscribe(
246+ this.tokenService .deleteAccount ().subscribe(
247247 res => console.log(res),
248248 error => console.log(error)
249249);
@@ -256,7 +256,7 @@ Validates the current token with the server.
256256
257257# ### Example:
258258` ` ` javascript
259- this._tokenService .validateToken ().subscribe(
259+ this.tokenService .validateToken ().subscribe(
260260 res => console.log(res),
261261 error => console.log(error)
262262);
@@ -268,7 +268,7 @@ Updates the password for the logged in user.
268268
269269# ### Example:
270270` ` ` javascript
271- this._tokenService .updatePassword({
271+ this.tokenService .updatePassword({
272272 password: ' newPassword' ,
273273 passwordConfirmation: ' newPassword' ,
274274 passwordCurrent: ' oldPassword' ,
@@ -286,7 +286,7 @@ Request a password reset from the server.
286286
287287# ### Example:
288288` ` ` javascript
289- this._tokenService .resetPassword({
289+ this.tokenService .resetPassword({
290290291291}).subscribe(
292292 res => console.log(res),
@@ -308,7 +308,7 @@ this route and call `processOAuthCallback()` to fetch `AuthData` from params.
308308# ### Example:
309309
310310` ` ` javascript
311- this._tokenService .signInOAuth(
311+ this.tokenService .signInOAuth(
312312' github'
313313).subscribe(
314314 res => console.log(res),
@@ -336,10 +336,10 @@ Callback component:
336336 template: ' '
337337})
338338export class OauthCallbackComponent implements OnInit {
339- constructor(private _tokenService : Angular2TokenService) {}
339+ constructor(private tokenService : Angular2TokenService) {}
340340
341341 ngOnInit () {
342- this._tokenService .processOAuthCallback ();
342+ this.tokenService .processOAuthCallback ();
343343 }
344344}
345345` ` `
@@ -357,7 +357,7 @@ If `apiPath` is configured it gets added in front of path.
357357
358358# ### Example:
359359` ` ` javascript
360- this._tokenService .get(' my-resource/1' ).map(res => res.json ()).subscribe(
360+ this.tokenService .get(' my-resource/1' ).map(res => res.json ()).subscribe(
361361 res => console.log(res),
362362 error => console.log(error)
363363);
@@ -370,20 +370,20 @@ The user type is selected during sign in and persists until sign out.
370370
371371# ### Example:
372372` ` ` javascript
373- this._tokenService .init({
373+ this.tokenService .init({
374374 userTypes: [
375375 { name: ' ADMIN' , path: ' admin' },
376376 { name: ' USER' , path: ' user' }
377377 ]
378378});
379379
380- this._tokenService .signIn({
380+ this.tokenService .signIn({
381381382382 password: ' secretPassword' ,
383383 userType: ' ADMIN'
384384})
385385
386- this._tokenService .currentUserType; // ADMIN
386+ this.tokenService .currentUserType; // ADMIN
387387` ` `
388388
389389# # Route Guards
@@ -416,7 +416,7 @@ More information can be found in the Angular2 API Reference [here](https://angul
416416
417417# ### Example:
418418` ` ` javascript
419- this._tokenService .request({
419+ this.tokenService .request({
420420 method: RequestMethod.Post,
421421 url: ' my-resource/1' ,
422422 data: mydata
@@ -453,7 +453,7 @@ Returns current authentication data as an HTTP ready Header object.
453453If you want to redirect to the protected URL after signing in, you need to set ` signInStoredUrlStorageKey` and in your code you can do something like this
454454
455455` ` ` js
456- this._tokenService .signIn({
456+ this.tokenService .signIn({
457457458458 password: ' secretPassword'
459459}).subscribe(
0 commit comments