當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript angularfire2.AngularFire類代碼示例

本文整理匯總了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';
 }
開發者ID:wjones0,項目名稱:cow,代碼行數:7,代碼來源:sets.ts

示例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?'});
 }
開發者ID:2947721120,項目名稱:angularfire2,代碼行數:7,代碼來源:firebase_list_example.ts

示例3: constructor

 constructor(af: AngularFire, store: Store<AppState>) {
   af.list('/events').do(data => {
     store.dispatch({
       type: 'RECEIVED_FROM_EVENTS',
       payload: data,
     });
   }).subscribe();
 }
開發者ID:devsunited,項目名稱:meetup,代碼行數:8,代碼來源:firebase-dispatcher.service.ts

示例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;
       });
     })
 }
開發者ID:jeffbcross,項目名稱:plzwork,代碼行數:9,代碼來源:people.ts

示例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');
    });
開發者ID:Denhai,項目名稱:everyday-butter,代碼行數:9,代碼來源:board.component.ts

示例6:

 get focusPhases$(): Observable<FocusPhase[] | any[]> {
   if (this.authService.isLoggedIn()) {
     return this.angularFire.list(`/users/${this.authUser.uid}/focusPhases`);
   } else {
     return Observable.of([]);
   }
 }
開發者ID:supermarcos,項目名稱:focus,代碼行數:7,代碼來源:data.service.ts

示例7:

 this._af.auth.subscribe((data) => {
     if (data) {
         this.userID = data.uid;
         this.dbURL = "/" + this.userID;
         this.characters = this._af.list(this.dbURL);
     } 
 })
開發者ID:wjones0,項目名稱:cow,代碼行數:7,代碼來源:characters.ts

示例8: getAllWorkouts

 getAllWorkouts(callback = (workouts) => {}) {
   let sub = this.af.list("/workouts/").subscribe((workouts) => {
     sub.unsubscribe();
     callback(workouts);
     return;
   });
 }
開發者ID:baseballlover723,項目名稱:angularattack2016-hairforce,代碼行數:7,代碼來源:workout.service.ts

示例9: getAllAssignments

 getAllAssignments(callback = (assignments) => {}) {
   let sub = this.af.list("/assignments/").subscribe((assignments) => {
     sub.unsubscribe();
     callback(assignments);
     return;
   });
 }
開發者ID:baseballlover723,項目名稱:angularattack2016-hairforce,代碼行數:7,代碼來源:assignment.service.ts

示例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) => {
開發者ID:davidrensh,項目名稱:ng2autoService,代碼行數:25,代碼來源:AdminLogin.ts


注:本文中的angularfire2.AngularFire類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。