Skip to content

Commit 93774c3

Browse files
committed
docs(README): FirebaseURL and defaultFirebase
1 parent 7774eb8 commit 93774c3

File tree

1 file changed

+44
-21
lines changed

1 file changed

+44
-21
lines changed

README.md

+44-21
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,24 @@ import {FIREBASE_PROVIDERS} from 'angularfire2';
2222
bootstrap(App, FIREBASE_PROVIDERS);
2323
```
2424

25+
### defaultFirebase
26+
27+
Define the root url for the library, to resolve relative paths.
28+
29+
Type: `string`
30+
31+
Usage:
32+
33+
```
34+
import {bootstrap} from 'angular2/core';
35+
import {FIREBASE_PROVIDERS, defaultFirebase} from 'angularfire2';
36+
37+
bootstrap(App, [
38+
FIREBASE_PROVIDERS,
39+
defaultFirebase('https://my.firebaseio.com')
40+
]);
41+
```
42+
2543
### FirebaseRef
2644

2745
Injectable symbol to create a Firebase reference based on
@@ -42,27 +60,6 @@ class MyComponent {
4260
}
4361
```
4462

45-
### FirebaseUrl
46-
47-
URL for the app's default Firebase database.
48-
49-
Type: `string`
50-
51-
Usage:
52-
53-
```
54-
import {App} from './app';
55-
import {bootstrap, provide} from 'angular2/core';
56-
import {FirebaseUrl, FIREBASE_PROVIDERS} from 'angularfire2';
57-
58-
bootstrap(App, [
59-
FIREBASE_PROVIDERS,
60-
provide(FirebaseUrl, {
61-
useValue: 'https://my.firebaseio.com'
62-
})
63-
]);
64-
```
65-
6663
### FirebaseList
6764

6865
A convenient provider to inject a remote list of
@@ -106,6 +103,32 @@ class QuestionsList {
106103
}
107104
```
108105

106+
### FirebaseUrl
107+
108+
URL for the app's default Firebase database.
109+
110+
Type: `string`
111+
112+
Usage:
113+
114+
```
115+
import {bootstrap, Inject} from 'angular2/core';
116+
import {FirebaseUrl, FIREBASE_PROVIDERS, defaultFirebase} from 'angularfire2';
117+
118+
@Component({
119+
selector: 'app',
120+
template: `<a [href]="url">{{ url }}</a>`
121+
})
122+
class App {
123+
constructor(@Inject(FirebaseUrl) public url: string) {}
124+
}
125+
126+
bootstrap(App, [
127+
FIREBASE_PROVIDERS,
128+
defaultFirebase('https://my.firebaseio.com')
129+
]);
130+
```
131+
109132
### FirebaseListConfig
110133

111134
Interface for config object that can be provided to `FirebaseList`

0 commit comments

Comments
 (0)