本文整理汇总了TypeScript中angularfire2/database/interfaces.AngularFireList类的典型用法代码示例。如果您正苦于以下问题:TypeScript AngularFireList类的具体用法?TypeScript AngularFireList怎么用?TypeScript AngularFireList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AngularFireList类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: removeQuote
removeQuote(quote: any){
this.quoteRef.remove(quote.key);
}
示例2: addQuote
addQuote (quote: any){
this.quoteRef.push(quote);
}
示例3: updateQuote
updateQuote(quote: any){
this.quoteRef.update(quote.key, {text: quote.text, votes: quote.votes});
}
示例4: upVoteQuote
upVoteQuote(quote: any){
this.quoteRef.update(quote.key, {votes: (parseInt(quote.votes)+1)});
}
示例5: getMigIpsum
getMigIpsum(){
this.quoteRef = this.angularFire.list('/quotes');
return this.quoteItems = this.quoteRef.snapshotChanges().map(changes => {
return changes.map(c => ({ key: c.payload.key, ...c.payload.val() }));
});
}
示例6: addImage
addImage (image: ImageModel){
this.imageRef.push(image);
}
示例7: removeImage
removeImage(image: any){
this.imageRef.remove(image.key);
}
示例8: updateImage
updateImage(image: any){
this.imageRef.update(image.key, {path: image.path, votes: image.votes});
}
示例9: getImages
getImages(){
this.imageRef = this.angularFire.list('/images');
return this.imageItems = this.imageRef.snapshotChanges().map(changes => {
return changes.map(c => ({ key: c.payload.key, ...c.payload.val() }));
});
}