Skip to content

Instantly share code, notes, and snippets.

@avatsaev
Last active May 21, 2017 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avatsaev/5c019f8a5b6cbbd8062b17d47e8f454d to your computer and use it in GitHub Desktop.
Save avatsaev/5c019f8a5b6cbbd8062b17d47e8f454d to your computer and use it in GitHub Desktop.
import {Component, OnInit, ViewChild} from '@angular/core';
import {AuthDialogComponent} from "../auth-dialog/auth-dialog.component";
import {AuthService} from "../services/auth.service";
import {Router} from "@angular/router";
@Component({
selector: 'app-toolbar',
templateUrl: './toolbar.component.html',
styleUrls: ['./toolbar.component.sass']
})
export class ToolbarComponent implements OnInit {
@ViewChild('authDialog') authDialog: AuthDialogComponent;
constructor(public authService:AuthService, private router:Router) { }
ngOnInit(){}
logOut(){
this.authService.logOutUser().subscribe(() => this.router.navigate(['/']));
}
presentAuthDialog(mode?: 'login'| 'register'){
this.authDialog.openDialog(mode);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment