|
| 1 | +<p align="center"> |
| 2 | + <h1 align="center">angular_fire</h1> |
| 3 | + <p align="center"> |
| 4 | + An <em>unofficial</em> library for <a href="https://webdev.dartlang.org/angular">AngularDart</a> and <a href="https://firebase.google.com">Firebase</a>. |
| 5 | + </p> |
| 6 | +</p> |
| 7 | + |
| 8 | +* [Install](#install) |
| 9 | +* [Usage](#usage) |
| 10 | + * [Components](#components) |
| 11 | + * [GoogleSignInComponent](#google-sign-in-component) |
| 12 | +* [Contributing](#contributing) |
| 13 | + * [Testing](#testing) |
| 14 | + |
| 15 | +## Install |
| 16 | + |
| 17 | +The current stable release of `angular_fire` works best with the following: |
| 18 | + |
| 19 | +```yaml |
| 20 | +dependencies: |
| 21 | + angular2: ^3.1.0 |
| 22 | + angular_fire: ^0.1.0 |
| 23 | + firebase: ^3.1.0 |
| 24 | +``` |
| 25 | +
|
| 26 | +To get started, you need to, at minimum, include the Firebase SDK: |
| 27 | +
|
| 28 | +```html |
| 29 | +<body> |
| 30 | + <script src="https://www.gstatic.com/firebasejs/4.0.0/firebase.js"></script> |
| 31 | +</body> |
| 32 | +``` |
| 33 | + |
| 34 | +<!-- TODO: Add an `example` folder. --> |
| 35 | + |
| 36 | +## Usage |
| 37 | + |
| 38 | +### Components |
| 39 | + |
| 40 | +#### GoogleSignInComponent |
| 41 | + |
| 42 | +Displays a rendered sign in box for Google authentication that follows the |
| 43 | +[branding guidelines](https://developers.google.com/identity/branding-guidelines). |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | +```dart |
| 48 | +import 'dart:html'; |
| 49 | +
|
| 50 | +import 'package:angular2'; |
| 51 | +import 'package:angular_fire/angular_fire.dart'; |
| 52 | +
|
| 53 | +@Component( |
| 54 | + selector: 'angular-fire-example', |
| 55 | + directives: const [ |
| 56 | + GoogleSignInComponent, |
| 57 | + ], |
| 58 | + template: r''' |
| 59 | + <google-sign-in (trigger)="onTrigger()"> |
| 60 | + </google-sign-in> |
| 61 | + |
| 62 | + <google-sign-in [useDarkTheme]="true" (trigger)="onTrigger()"> |
| 63 | + </google-sign-in> |
| 64 | + ''', |
| 65 | +) |
| 66 | +class AngularFireExample { |
| 67 | + void onTrigger() { |
| 68 | + window.alert('Pressed!'); |
| 69 | + } |
| 70 | +} |
| 71 | +``` |
| 72 | + |
| 73 | +**NOTE**: To use this component, you must have the brand assets in your |
| 74 | +`web/assets` directory, or use the `[assetPath]` property, or the |
| 75 | +`googleSignInAssetPath` token at `bootstrap` time to configure the location of |
| 76 | +your assets - for example on an external CDN. |
| 77 | + |
| 78 | +## Contributing |
| 79 | + |
| 80 | +We welcome a diverse set of contributions, including, but not limited to: |
| 81 | +* [Filing bugs and feature requests][file_issue] |
| 82 | +* [Send a pull request][pull_request] |
| 83 | +* Or, create something awesome using this API and share with us and others! |
| 84 | + |
| 85 | +For the stability of the API and existing users, consider opening an issue |
| 86 | +first before implementing a large new feature or breaking an API. For smaller |
| 87 | +changes (like documentation, bug fixes), just send a pull request. |
| 88 | + |
| 89 | +[file_issue]: https://github.com/matanlurey/angular_fire/issues/new |
| 90 | +[pull_request]: https://github.com/matanlurey/angular_fire/pulls/new |
| 91 | + |
| 92 | +### Testing |
| 93 | + |
| 94 | +Run the (simple) test suite in Dartium: |
| 95 | + |
| 96 | +```shell |
| 97 | +$ pub run angular_test -p dartium |
| 98 | +``` |
0 commit comments