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


TypeScript FirebaseListObservable.push方法代碼示例

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


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

示例1:

 handler: data => {
   if (isNew) {
     this.ListaPlaca.push({ 'placa': data.placa, 'tipo' : data.tipo });
   } else {
     this.ListaPlaca.update(placa, { placa: data.placa });
   }
 }
開發者ID:iacapuca,項目名稱:mausmotoristas,代碼行數:7,代碼來源:historico.ts

示例2: save

 private save(item: any) {
   if (item.$key) {
     return this.items.update(item.$key, { name: item.name });
   } else {
     return this.items.push({ name: item.name, url: item.url, fullPath: item.fullPath });
   }
 }
開發者ID:joaorobertoifrn,項目名稱:ionicfirebaseauth,代碼行數:7,代碼來源:contact-service.ts

示例3: createRecipe

  createRecipe(recipe: Recipe) {
    console.log('create');
    const recipeResponse = this.recipes.push(recipe);
    const myRecipes = this.db.object(`chefs/${this.chefSvc.currentUserId}/my-recipes/${recipeResponse.key}`);
    myRecipes.set(true);

    this.router.navigate(['/recipes', recipeResponse.key]);
  }
開發者ID:lendog75,項目名稱:RecipeBox,代碼行數:8,代碼來源:recipe.service.ts

示例4: addTable

 addTable(newName: string) {
   this.tablesDB.push({ name: newName, count: "0", data:
     [
       {name: "player1", money: "0"},
       {name: "player2", money: "0"},
       {name: "player3", money: "0"},
       {name: "player4", money: "0"}
     ] });
 }
開發者ID:SimonFolger,項目名稱:angular-card-table,代碼行數:9,代碼來源:app.component.ts

示例5: sendMessage

 sendMessage (message: string) {
   console.log(this.user)
   const { email } = this.user
   const timestamp = this.getTimeStamp()
   this.chatMessages = this.getMessages()
   this.chatMessages.push({
     email,
     message,
     timeSent: timestamp,
   })
   console.log('send message!')
 }
開發者ID:xrr2016,項目名稱:angular-firebase-chat,代碼行數:12,代碼來源:chat.service.ts

示例6: sendInquiryData

 sendInquiryData(name : string, email : string, message : string){
   if(name == null || email == null || message == null){
     this.fieldsRequired = true;
   }
   else
   {    
     this.fieldsRequired = false;
     this.items.push({name: name, email: email, message: message});
     this.name = null;
     this.email = null;
     this.message = null;
   }
 }
開發者ID:TimGoonan,項目名稱:Slipslo,代碼行數:13,代碼來源:footer.component.ts

示例7: sendSubmissionData

 sendSubmissionData(topic : string, option1 : string, option2 : string){
   if(topic == null || option1 == null || option2 == null){
     this.fieldsRequired = true;
   }
   else
   {
     this.fieldsRequired = false;
     this.items.push({topic: topic, option1: option1, option2: option2, voteCount: 0});
     this.topic = null;
     this.option1 = null;
     this.option2 = null;
   }
 }
開發者ID:TimGoonan,項目名稱:Slipslo,代碼行數:13,代碼來源:submit.component.ts

示例8: createPlaca

  public createPlaca(){
    this.placaModel =  this.placaModel.replace(/-/gi,'')
    this.placaModel =  this.placaModel.replace(/_/gi,'')
    this.ListaPlaca.push({placa:this.placaModel, tipo:this.tipoModel});
    this.toastOptions = {
      message: "Denuncia da placa " + this.placaModel + " efetuada.",
      duration: 3000,
      position: 'top',
    }
    this.toast.create(this.toastOptions).present();
    this.placaModel = '';


}
開發者ID:iacapuca,項目名稱:mausmotoristas,代碼行數:14,代碼來源:denuncia.ts

示例9: Error

 .then(authRes => {
   window.localStorage.setItem('uid', authRes.uid);
   this.medicos.push({
     email         : data.email,
     nome          : data.nome,
     crm           : data.crm,
     especialidade : data.especialidade.toUpperCase(),
     estado        : data.estado.toUpperCase(),
     cidade        : data.cidade.toUpperCase(),
     bairro        : data.bairro,
     logradouro    : data.logradouro,
     uid           : authRes.uid
   }).then(res => {
     return firebase.Promise.resolve();
   }, error => {
     // TODO Rollback na criação do usuário de autenticação
     console.error("cadastro de usuário - ", error);
     return firebase.Promise.reject(new Error("falha ao cadastrar médico na base"));
   });
 }, error => {
開發者ID:TiagoAMarek,項目名稱:app-medico,代碼行數:20,代碼來源:auth.ts

示例10: addDrink

 addDrink(drinker: Drinker, drank: number): void {
   this.drinks.push({drinkerKey: drinker.$key, amount: drank, time: moment.utc().toJSON()});
 }
開發者ID:adamstegman,項目名稱:drank,代碼行數:3,代碼來源:drinks.service.ts


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