本文整理汇总了TypeScript中angularfire2/database.FirebaseListObservable类的典型用法代码示例。如果您正苦于以下问题:TypeScript FirebaseListObservable类的具体用法?TypeScript FirebaseListObservable怎么用?TypeScript FirebaseListObservable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FirebaseListObservable类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: 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
示例2:
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
示例3:
this.sub = this.route.params.subscribe(params => {
if(params['id'] != null) {
this.id = params['id'];
console.log(this.id);
this.items = db.list('/data', { preserveSnapshot: true });
this.items
.subscribe(snapshots => {
snapshots.forEach(snapshot => {
console.log(snapshot.key)
console.log(snapshot.val().baslik)
if(this.id == snapshot.key)
{
this.Form.controls["yazi"].setValue(snapshot.val().yazi);
this.Form.controls["baslik"].setValue(snapshot.val().baslik);
this.Form.controls["yazar"].setValue(snapshot.val().yazar);
this.Form.controls["img"].setValue(snapshot.val().img);
}
});
})
}
});
开发者ID:ardabozok,项目名称:Project,代码行数:28,代码来源:component.edit.ts
示例4: updateItem
updateItem() {
console.log(this.Form.value.baslik);
this.items.update(this.id, {baslik: this.Form.value.baslik,
yazi: this.Form.value.yazi,
img: this.Form.value.img,
yazar: this.Form.value.yazar});
}
开发者ID:ardabozok,项目名称:Project,代码行数:8,代码来源:component.edit.ts
示例5: 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
示例6: 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
示例7: incrementVoteValue
incrementVoteValue(result:Submit){
if(result == null){
console.log("Error");
this.nothingChecked = true;
}
else{
result.vote = result.vote + 1;
this.items.update(result.$key, result);
this.nothingChecked = false;
}
}
开发者ID:TimGoonan,项目名称:Slipslo,代码行数:11,代码来源:longtermvote.component.ts
示例8: 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
示例9: 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
示例10: 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
注:本文中的angularfire2/database.FirebaseListObservable类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论