Skip to content

Commit 0f3c600

Browse files
committed
feat(package): added onCreateAccountRequested event ngx-auth-firebaseui-login comp. #316
1 parent 4071c63 commit 0f3c600

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

demo/src/app/home/home.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ <h1>ngx-auth-firebaseui</h1>
2323

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

2929
<!-- &lt;!&ndash;toolbar&ndash;&gt;-->

demo/src/app/home/home.component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import {Component, OnDestroy, OnInit, ViewEncapsulation} from '@angular/core';
22
import {Title} from '@angular/platform-browser';
33
import {AngularFireAuth} from '@angular/fire/auth';
44
import {AuthProvider, Theme} from 'ngx-auth-firebaseui';
5-
import { MatSnackBar } from '@angular/material/snack-bar';
6-
import { MatTabChangeEvent } from '@angular/material/tabs';
5+
import {MatSnackBar} from '@angular/material/snack-bar';
6+
import {MatTabChangeEvent} from '@angular/material/tabs';
77
import {Router} from '@angular/router';
88
import {Subscription} from 'rxjs/internal/Subscription';
99

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

137+
createAccount() {
138+
console.log('create account has beeen requested');
139+
}
137140
}

src/module/components/ngx-auth-firebaseui-login/ngx-auth-firebaseui-login.component.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@
7474

7575
<div class="register" fxLayout="column" fxLayoutAlign="center center">
7676
<span class="text">{{dontHaveAnAccountText}}</span>
77-
<button mat-button color="primary" type="button">{{createAccountButtonText}}</button>
77+
<button mat-button
78+
color="primary"
79+
type="button"
80+
(click)="onCreateAccountRequested.emit()">{{createAccountButtonText}}</button>
7881
</div>
7982

8083
</div>

src/module/components/ngx-auth-firebaseui-login/ngx-auth-firebaseui-login.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component, Input, OnInit, Output, ViewEncapsulation} from '@angular/core';
1+
import {Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation} from '@angular/core';
22
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
33
import {MatFormFieldAppearance} from '@angular/material';
44
import {AuthProvider} from '../../..';
@@ -39,6 +39,7 @@ export class NgxAuthFirebaseuiLoginComponent implements OnInit {
3939
// Events
4040
@Output() onSuccess: any;
4141
@Output() onError: any;
42+
@Output() onCreateAccountRequested: EventEmitter<void> = new EventEmitter<void>();
4243

4344
constructor(private _formBuilder: FormBuilder) {
4445
}

0 commit comments

Comments
 (0)