Last active
May 21, 2017 11:20
-
-
Save avatsaev/5c019f8a5b6cbbd8062b17d47e8f454d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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