Last active
February 10, 2017 14:48
-
-
Save avatsaev/10dc8b6ed0bab750a78ef94c6675e4df 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, Input, EventEmitter} from '@angular/core'; | |
import {MaterializeAction} from "angular2-materialize"; | |
@Component({ | |
selector: 'app-auth-dialog', | |
templateUrl: './auth-dialog.component.html', | |
styleUrls: ['./auth-dialog.component.sass'] | |
}) | |
export class AuthDialogComponent implements OnInit { | |
@Input('auth-mode') authMode: 'login' | 'register' = 'login'; | |
modalActions = new EventEmitter<string|MaterializeAction>(); | |
constructor() { | |
} | |
openDialog(mode: 'login' | 'register' = 'login'){ | |
this.authMode = mode; | |
this.modalActions.emit({action:"modal", params:['open']}); | |
} | |
ngOnInit() { | |
} | |
isLoginMode(){return this.authMode == 'login'} | |
isRegisterMode(){return this.authMode == 'register'} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment