本文整理汇总了TypeScript中angularfire2.AngularFire类的典型用法代码示例。如果您正苦于以下问题:TypeScript AngularFire类的具体用法?TypeScript AngularFire怎么用?TypeScript AngularFire使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AngularFire类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(private _nav: NavController, private _af: AngularFire, private _navParams: NavParams) {
this.charName = this._navParams.get('charName');
this.charID = this._navParams.get('charID');
this.dbURL = this._navParams.get('dbURL') + '/' + this.charID + '/sets';
this.sets = this._af.list(this.dbURL);
this.selSetFilter = 'incomplete';
}
示例2: constructor
constructor(public af:AngularFire) {
var ref = new Firebase(rootFirebase);
ref.remove();
this.questions = af.list('/questions');
this.questions.add({question: 'why?'});
this.questions.add({question: 'how?'});
}
示例3: constructor
constructor(af: AngularFire, store: Store<AppState>) {
af.list('/events').do(data => {
store.dispatch({
type: 'RECEIVED_FROM_EVENTS',
payload: data,
});
}).subscribe();
}
示例4: constructor
constructor(af:AngularFire) {
this.people = af.list('/people')
.map(people => {
return people.map(person => {
person.todos = af.list(`/todos/${person.$key}`)
return person;
});
})
}
示例5:
af.auth.asObservable().filter(user => user !== null).subscribe(user => { // Skip null values
this.boardURL = 'users/' + user.uid + '/boards/' + routeParams.get('key');
this.board = af.object(this.boardURL);
this.lists = af.list(this.boardURL + '/lists', { query: { orderByChild: 'priority' } });
this.tasks = af.list(this.boardURL + '/tasks', { query: { orderByChild: 'priority' } });
this.listObservable = af.list(this.boardURL + '/lists');
this.taskObservable = af.list(this.boardURL + '/tasks');
});
示例6:
get focusPhases$(): Observable<FocusPhase[] | any[]> {
if (this.authService.isLoggedIn()) {
return this.angularFire.list(`/users/${this.authUser.uid}/focusPhases`);
} else {
return Observable.of([]);
}
}
示例7:
this._af.auth.subscribe((data) => {
if (data) {
this.userID = data.uid;
this.dbURL = "/" + this.userID;
this.characters = this._af.list(this.dbURL);
}
})
示例8: getAllWorkouts
getAllWorkouts(callback = (workouts) => {}) {
let sub = this.af.list("/workouts/").subscribe((workouts) => {
sub.unsubscribe();
callback(workouts);
return;
});
}
示例9: getAllAssignments
getAllAssignments(callback = (assignments) => {}) {
let sub = this.af.list("/assignments/").subscribe((assignments) => {
sub.unsubscribe();
callback(assignments);
return;
});
}
示例10: Date
this.af.auth.login({ email: this.rs.genEmail(phone), password: this.password }).then((authData) => {
//console.log("Rs2:" + authData.uid);
this.authData = authData;
//localStorage.setItem('uid', authData.uid);
this.rs.uid = authData.uid;
var usersRef = this.af.object("/users/" + this.authData.uid);
usersRef.update({
lastlogin: (new Date()).toISOString()
});
usersRef.subscribe(res => {
let role = res.role;
this.rs.dealer = res.dealername;
this.rs.role = res.role;
this.rs.uid = res.uid;
this.rs.ownerId = res.ownerid;
this.rs.phone = res.phone;
this.rs.fname = res.fname;
this.rs.lname = res.lname;
//console.log("role:" + role + " getRole:" + this.rs.role);
}
);
}).catch((error) => {