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


TypeScript FirebaseListObservable.push方法代碼示例

本文整理匯總了TypeScript中angularfire2.FirebaseListObservable.push方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript FirebaseListObservable.push方法的具體用法?TypeScript FirebaseListObservable.push怎麽用?TypeScript FirebaseListObservable.push使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在angularfire2.FirebaseListObservable的用法示例。


在下文中一共展示了FirebaseListObservable.push方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: new

    new(item: T): any {
        let result = this.firebaseList.push(item);
        console.log(result);
        result.then(success => console.log("successfully added new item to " + this.endpoint, success), failure => console.log("failure", failure));
        return result;

    }
開發者ID:chuckjaz,項目名稱:ames,代碼行數:7,代碼來源:firebase.service.ts

示例2: sendMessage

 sendMessage(message:string) {
     this.messages$.push({
         author: this.identity.name,
         body: message
     });
     this.message = '';
 }
開發者ID:mjrio,項目名稱:mjr-cordova-ionic,代碼行數:7,代碼來源:home.ts

示例3: create

 create(userId:string,title: string, description: string,isPublic:boolean,photos:any): void {
   this.db.push({userId,
     title,
     description,isPublic,photos   
   });
   
 }
開發者ID:Omri27,項目名稱:Afeka-Face,代碼行數:7,代碼來源:post.service.ts

示例4: createVehicle

 createVehicle(vehicle: IVehicle): firebase.Promise<any> {
   return this.vehicles$.push(new Vehicle(
     vehicle.make,
     vehicle.model,
     vehicle.year
   ));
 }
開發者ID:bgauvey,項目名稱:service-tracker,代碼行數:7,代碼來源:vehicle.service.ts

示例5: addClass

 addClass(className: string, classPassword: string ) {
   if ( className.length < 1 ) {
     this.errorMessage = this.authService.getErrorMsg('error',
       { code: 'OwnText', text: 'Názov triedy nieje vyplnený' } );
     return;
   }
   if ( classPassword.length < 1 ) {
     this.errorMessage = this.authService.getErrorMsg('error',
       { code: 'OwnText', text: 'Heslo triedy nieje vyplnené' } );
     return;
   }
   if ( this.vyhodnotExistenciuHesla) {
     return;
   }
   if (this.classId) {
     let classData = this.angularFire.database.object('/CLASSES/' + this.classId);
     classData.update({className: className, heslo: classPassword} );
     this.errorMessage = this.authService.getErrorMsg('success', { code: 'OwnText', text: 'Zmeny boli úspešne zapísané' } );
     setTimeout(() => {this.router.navigate(['classes']); }, 2000);
   }else {
     this.items.push(new Trieda ( className, classPassword, this.uId));
     this.errorMessage = this.authService.getErrorMsg('success', { code: 'OwnText', text: 'Trieda bola úspešne vytvorená' } );
     setTimeout(() => {this.router.navigate(['classes']); }, 2000);
   }
 }
開發者ID:linhart2,項目名稱:Diplomova_praca,代碼行數:25,代碼來源:create-class-page.component.ts

示例6: send

 send(text: string) {
   this.messages.push({
     text: text,
     userName: this.userName,
     avatar: this.avatar
   });
 }
開發者ID:OoogleBoogle,項目名稱:angfire2-chat,代碼行數:7,代碼來源:textbox.component.ts

示例7: addItem

 addItem(e: Event) {
     e.preventDefault();
     this.items.push({
         name: this.itemName
     });
     this.clear();
 }
開發者ID:chuckhendo,項目名稱:angular2-firebase-test,代碼行數:7,代碼來源:app.component.ts

示例8: addStory

 //stories
 addStory(newTitle:string) {
     this.stories.push({
         title: newTitle,
         status: 'active',
         sections: []
     });
 }
開發者ID:aortyl,項目名稱:crispy-writer,代碼行數:8,代碼來源:new-story.component.ts

示例9: new

 new(item : T) : any {
     let result = this.firebaseList.push(item);
     console.log(result);
     result.then(success => console.log("success",success), failure => console.log("failure",failure));
     return result;
     
 }
開發者ID:edicon,項目名稱:ames,代碼行數:7,代碼來源:firebase.service.ts

示例10: saveEvent

 saveEvent(data:Array<any>) {
     let promise = this._events.push(data);
     
     return promise.then(
         (res) => { return { code: "Event saved succesfully" } },
         (err) => { return { code: err } }
     )
 }
開發者ID:aroget,項目名稱:ng2-landr,代碼行數:8,代碼來源:events.service.ts


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