本文整理匯總了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() }));
});
}