当前位置: 首页>>代码示例>>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;未经允许,请勿转载。