Skip to content

Instantly share code, notes, and snippets.

@avatsaev
Last active February 10, 2017 14:48
Show Gist options
  • Save avatsaev/10dc8b6ed0bab750a78ef94c6675e4df to your computer and use it in GitHub Desktop.
Save avatsaev/10dc8b6ed0bab750a78ef94c6675e4df to your computer and use it in GitHub Desktop.
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