Skip to content

Commit 17d96a8

Browse files
committed
docs(project): updated the readme - added usaged and api sections + demo imgs
1 parent 28c0010 commit 17d96a8

File tree

4 files changed

+282
-162
lines changed

4 files changed

+282
-162
lines changed

README.md

Lines changed: 118 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,21 @@
1515
[![Greenkeeper Badge](https://badges.greenkeeper.io/firebaseui/ng-bootstrap.svg)](https://greenkeeper.io/)
1616
[![license](https://img.shields.io/github/license/firebaseui/ng-bootstrap.svg?style=flat-square)](https://github.com/firebaseui/ng-bootstrap/blob/master/LICENSE)
1717

18+
![firebaseui/ng-bootstrap - sign in, sign up demo image](https://raw.githubusercontent.com/firebaseui/ng-bootstrap/HEAD/assets/v2.0.0/sign_in_up.png)
19+
![firebaseui/ng-bootstrap - reset password demo image](https://raw.githubusercontent.com/firebaseui/ng-bootstrap/HEAD/assets/v2.0.0/reset_password.png)
20+
21+
1822
## Built by and for developers :heart:
1923
Do you have any question or suggestion ? Please do not hesitate to contact us!
2024
Alternatively, provide a PR | open an appropriate issue [here](https://github.com/firebaseui/ng-bootstrap/issues)
2125

2226
If did you like this project, support [@firebaseui/ng-bootstrap](https://github.com/firebaseui/ng-bootstrap)
2327
by starring :star: and sharing it :loudspeaker:
2428

29+
If you prefer to develop with material design rather than with bootstrap, please check this project [ngb-auth-firebaseui](https://github.com/AnthonyNahas/ngb-auth-firebaseui)
30+
2531
## Table of Contents
26-
- [@firebaseui/ng-bootstrap :heart: ngx-auth-firebaseui | vs firebaseui-web](#vs)
32+
- [@firebaseui/ng-bootstrap :heart: ngb-auth-firebaseui | vs firebaseui-web](#vs)
2733
- [Why to use @firebaseui/ng-bootstrap ?](#@firebaseui/ng-bootstrap)
2834
- [Library's components](#components)
2935
- [Supported Providers](#supported-procress-and-actions)
@@ -49,9 +55,9 @@ by starring :star: and sharing it :loudspeaker:
4955

5056
<a name="vs"/>
5157

52-
## ngx-auth-firebaseui vs firebaseui-web
58+
## ngb-auth-firebaseui vs firebaseui-web
5359

54-
| Features | @firebaseui/ng-bootstrap | ngx-auth-firebaseui | firebaseui |
60+
| Features | @firebaseui/ng-bootstrap | ngb-auth-firebaseui | firebaseui |
5561
| --------------------------------------------------------------|:-------------: |:-------------:| :-------------------: |
5662
| Sign Up | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
5763
| Sign In | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
@@ -84,7 +90,7 @@ by starring :star: and sharing it :loudspeaker:
8490
| AWESOME | :heavy_check_mark: | :heavy_check_mark: | :interrobang: |
8591

8692

87-
<a name="why-to-use-ngx-auth-firebaseui"/>
93+
<a name="why-to-use-ngb-auth-firebaseui"/>
8894

8995
## Why to use @firebaseui/ng-boostrap ?
9096
- :gift_heart: it uses a responsive and accessible web design UX/UI from twitter bootstrap concepts and components (supporting desktop and mobile view).
@@ -96,7 +102,7 @@ by starring :star: and sharing it :loudspeaker:
96102
- :soon: built in feedback mechanism in form of a [alert](https://ng-bootstrap.github.io/#/components/alert/examples) when an error or any important event occurred.
97103
- :soon: ability to sign out or even to delete totally the account
98104
- :ghost: your client does not want to create an account in your project? Let him to sign in anonymously!
99-
- :soon: user profile component to display user's data using <ngx-auth-firebaseui-user></ngx-auth-firebaseui-user> via `ngx-auth-firebaseui-user`
105+
- :soon: user profile component to display user's data using <ngb-auth-firebaseui-user></ngb-auth-firebaseui-user> via `ngb-auth-firebaseui-user`
100106
- :zap: update user profile as feature
101107
- :fire: [Sync user's authentication with FIRESTORE](FIRESTORE_SYNC.md) **AUTOMATICALLY**
102108
- :muscle: Forgot Password feature! Go and let your users to recover their passwords easily
@@ -128,7 +134,7 @@ by starring :star: and sharing it :loudspeaker:
128134
- sign in
129135
- sign in Anonymously | with google, facebook, twitter, github
130136
- sign out
131-
- validation of password's strength while creating a new account using [ngx-material-password-strength](https://github.com/AnthonyNahas/ngx-material-password-strength) :soon:
137+
- validation of password's strength while creating a new account using [ngb-material-password-strength](https://github.com/AnthonyNahas/ngb-material-password-strength) :soon:
132138
- forgot/reset password
133139
- sending email verifications
134140
- delete user's account :soon:
@@ -146,7 +152,7 @@ by starring :star: and sharing it :loudspeaker:
146152

147153
<a name="demo"/>
148154

149-
## [Demo](https://ngx-auth-firebaseui.firebaseapp.com/)
155+
## [Demo](https://ngb-auth-firebaseui.firebaseapp.com/)
150156

151157
- Try it out
152158
```js
@@ -188,7 +194,14 @@ import { NgbAuthFirebaseUIModule } from '@firebaseui/ng-bootstrap';
188194

189195
@NgModule({
190196
declarations: [AppComponent, ...],
191-
imports: [NgbAuthFirebaseUIModule.forRoot(), ...],
197+
imports: [NgbAuthFirebaseUIModule.forRoot({
198+
apiKey: 'your-firebase-apiKey',
199+
authDomain: 'your-firebase-authDomain',
200+
databaseURL: 'your-firebase-databaseURL',
201+
projectId: 'your-firebase-projectId',
202+
storageBucket: 'your-firebase-storageBucket',
203+
messagingSenderId: 'your-firebase-messagingSenderId'
204+
}), ...],
192205
bootstrap: [AppComponent]
193206
})
194207
export class AppModule {
@@ -208,8 +221,102 @@ export class OtherModule {
208221
}
209222
```
210223

224+
<a name="usage"/>
225+
211226
## Usage
212227

228+
### `<ngb-auth-firebaseui></ngb-auth-firebaseui>`
229+
230+
```html
231+
<!-- You can now use the library component in app.component.html -->
232+
233+
<ngb-auth-firebaseui (onSuccess)="printUser($event)"
234+
(onError)="printError()">
235+
</ngb-auth-firebaseui>
236+
```
237+
or
238+
```typescript
239+
<!-- or simply in the app.component.ts -->
240+
@Component({
241+
selector: 'app',
242+
template: `
243+
<ngb-auth-firebaseui (onSuccess)="printUser($event)" (onError)="printError()"></ngb-auth-firebaseui>`
244+
})
245+
class AppComponent {
246+
247+
printUser(event) {
248+
console.log(event);
249+
}
250+
251+
printError(event) {
252+
console.error(event);
253+
}
254+
}
255+
```
256+
257+
### `<ngb-auth-firebaseui-providers></ngb-auth-firebaseui-providers>`
258+
```html
259+
<!-- You can now use the library component in app.component.html -->
260+
<ngb-auth-firebaseui-providers layout="column"></ngb-auth-firebaseui-providers>
261+
```
262+
263+
<a name="api"/>
264+
265+
## API
266+
267+
### `<ngb-auth-firebaseui></ngb-auth-firebaseui>`
268+
269+
| option | bind | type | default | description |
270+
|:---------------------|:------:|:------:|:------------:|:-------------------------------------------------------------------------------------------------|
271+
| guestEnabled | Input() | boolean | `true` | whether the user can sign in and continue as guest
272+
| providers | Input() | string[] | ['all'] or [AuthProvider.All] | choose your favorite authentication provider: google | facebook | twitter | github
273+
| onSuccess | Output() | any | - | this will be fired when an authentication process was success. The authenticated user is emitted!
274+
| onError | Output() | any | - | this event will be fired when an error occurred during the authentication process! An error message is emitted!
275+
276+
277+
### How to disable users to sign in and continue as guest, use the `guestEnabled` input
278+
279+
```html
280+
<ngb-auth-firebaseui [guestEnabled]="false"
281+
(onSuccess)="printUser($event)"
282+
(onError)="printError($event)">
283+
</ngb-auth-firebaseui>
284+
```
285+
286+
### How to configure your input providers ? [see the examples](https://ngb-auth-firebaseui.firebaseapp.com/examples)
287+
e.g:
288+
in your component, import the AuthProvider enum to pick up your favorite provider:
289+
290+
```typescript
291+
import {OnInit} from '@angular/core';
292+
import {AuthProvider} from '@firebaseui/ng-bootstrap';
293+
294+
export class ExampleComponent implements OnInit {
295+
296+
providers = AuthProvider;
297+
298+
ngOnInit() {
299+
}
300+
}
301+
```
302+
303+
in your template -->
304+
```html
305+
<ngb-auth-firebaseui
306+
[providers]="[providers.Google, providers.Facebook, providers.Twitter]"
307+
(onSuccess)="printUser($event)"
308+
(onError)="printError()"></ngb-auth-firebaseui>
309+
```
310+
311+
or
312+
313+
```html
314+
<ngb-auth-firebaseui
315+
[providers]="['google', 'facebook', 'twitter']"
316+
(onSuccess)="printUser($event)"
317+
(onError)="printError()">
318+
</ngb-auth-firebaseui>
319+
```
213320

214321
<a name="run-demo-app-locally"/>
215322

@@ -219,7 +326,7 @@ export class OtherModule {
219326
```bash
220327
$ git clone https://github.com/firebaseui/ng-bootstrap.git
221328
```
222-
- link the ngx-auth-firebaseui package
329+
- link the ngb-auth-firebaseui package
223330
use gulp globally
224331
```bash
225332
$ gulp link
@@ -266,7 +373,7 @@ $ npm run lint
266373
<a name="other-angular-libraries"/>
267374

268375
## Other Angular Libraries
269-
- [ngx-auth-firebaseui](https://github.com/AnthonyNahas/ngx-auth-firebaseui)
376+
- [ngb-auth-firebaseui](https://github.com/AnthonyNahas/ngb-auth-firebaseui)
270377
- [@angular-material-extensions/password-strength](https://github.com/angular-material-extensions/password-strength)
271378
- [@angular-material-extensions/pages](https://github.com/angular-material-extensions/pages)
272379
- [@angular-material-extensions/contacts](https://github.com/angular-material-extensions/contacts)
@@ -280,7 +387,7 @@ $ npm run lint
280387
## Support
281388
+ Drop an email to: [Anthony Nahas](mailto:anthony.na@hotmail.de)
282389
+ or open an appropriate [issue](https://github.com/firebaseui/ng-bootstrap/issues)
283-
+ let us chat on [Gitter](https://gitter.im/ngx-auth-firebaseui/Lobby)
390+
+ let us chat on [Gitter](https://gitter.im/ngb-auth-firebaseui/Lobby)
284391

285392
Built by and for developers :heart: we will help you :punch:
286393

assets/v2.0.0/reset_password.png

125 KB
Loading

assets/v2.0.0/sign_in_up.png

145 KB
Loading

0 commit comments

Comments
 (0)