Skip to content

Commit 1086e15

Browse files
committed
chore: make firebase_list_example a ts file
1 parent 49db401 commit 1086e15

File tree

2 files changed

+32
-10
lines changed

2 files changed

+32
-10
lines changed

test/e2e/firebase_list/firebase_list_example.js

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import {Component, Inject, provide} from 'angular2/core';
2+
import {bootstrap} from 'angular2/platform/browser';
3+
import {DEFAULT_FIREBASE, FirebaseList, FirebaseObservable} from 'angularfire2';
4+
// var Firebase = require('firebase');
5+
import Firebase from 'firebase';
6+
const rootFirebase = 'https://answers-mobile.firebaseio.com/';
7+
8+
var ref = new Firebase(rootFirebase);
9+
ref.child('questions').set([{
10+
question: 'why?'
11+
},{
12+
question: 'how?'
13+
}]);
14+
@Component({
15+
template: `
16+
<h1>Hello</h1>
17+
<div *ngFor="#question of questions | async">
18+
{{question.val().question}}
19+
</div>
20+
`,
21+
selector: 'app',
22+
providers: [FirebaseList('/questions')]
23+
})
24+
class App {
25+
constructor(@Inject('/questions') public questions:FirebaseObservable<any>) {
26+
}
27+
}
28+
29+
bootstrap(App, [
30+
provide(DEFAULT_FIREBASE, {
31+
useValue: rootFirebase
32+
})]);

0 commit comments

Comments
 (0)