Skip to content

Commit

Permalink
feat(package): added onCreateAccountRequested event `ngx-auth-firebas…
Browse files Browse the repository at this point in the history
…eui-login` comp. #316
  • Loading branch information
AnthonyNahas committed Aug 15, 2019
1 parent 4071c63 commit 0f3c600
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion demo/src/app/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h1>ngx-auth-firebaseui</h1>

<section class="home">
<div class="container">
<ngx-auth-firebaseui-login></ngx-auth-firebaseui-login>
<ngx-auth-firebaseui-login appearance="outline" (onCreateAccountRequested)="createAccount()"></ngx-auth-firebaseui-login>
<!-- <div fxLayout="column">-->

<!-- &lt;!&ndash;toolbar&ndash;&gt;-->
Expand Down
7 changes: 5 additions & 2 deletions demo/src/app/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {Component, OnDestroy, OnInit, ViewEncapsulation} from '@angular/core';
import {Title} from '@angular/platform-browser';
import {AngularFireAuth} from '@angular/fire/auth';
import {AuthProvider, Theme} from 'ngx-auth-firebaseui';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatTabChangeEvent } from '@angular/material/tabs';
import {MatSnackBar} from '@angular/material/snack-bar';
import {MatTabChangeEvent} from '@angular/material/tabs';
import {Router} from '@angular/router';
import {Subscription} from 'rxjs/internal/Subscription';

Expand Down Expand Up @@ -134,4 +134,7 @@ export class HomeComponent implements OnInit, OnDestroy {
console.log('Account Delete successful!');
}

createAccount() {
console.log('create account has beeen requested');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@

<div class="register" fxLayout="column" fxLayoutAlign="center center">
<span class="text">{{dontHaveAnAccountText}}</span>
<button mat-button color="primary" type="button">{{createAccountButtonText}}</button>
<button mat-button
color="primary"
type="button"
(click)="onCreateAccountRequested.emit()">{{createAccountButtonText}}</button>
</div>

</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Component, Input, OnInit, Output, ViewEncapsulation} from '@angular/core';
import {Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation} from '@angular/core';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {MatFormFieldAppearance} from '@angular/material';
import {AuthProvider} from '../../..';
Expand Down Expand Up @@ -39,6 +39,7 @@ export class NgxAuthFirebaseuiLoginComponent implements OnInit {
// Events
@Output() onSuccess: any;
@Output() onError: any;
@Output() onCreateAccountRequested: EventEmitter<void> = new EventEmitter<void>();

constructor(private _formBuilder: FormBuilder) {
}
Expand Down

0 comments on commit 0f3c600

Please sign in to comment.