Skip to content

Instantly share code, notes, and snippets.

@avatsaev
Last active May 21, 2017 11:21
Show Gist options
  • Save avatsaev/4863955bf96d73574b03b5585022236d to your computer and use it in GitHub Desktop.
Save avatsaev/4863955bf96d73574b03b5585022236d to your computer and use it in GitHub Desktop.
import { Component, OnInit } from '@angular/core';
import {Router} from "@angular/router";
import {AuthService} from "../services/auth.service";
import {Angular2TokenService} from "angular2-token";
@Component({
selector: 'app-profile',
templateUrl: './profile.component.html',
styleUrls: ['./profile.component.sass']
})
export class ProfileComponent implements OnInit {
constructor(public authTokenService:Angular2TokenService,
public authService:AuthService,
private router:Router) {}
logOut(){
this.authService.logOutUser().subscribe(() => this.router.navigate(['/']));
}
ngOnInit() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment