2
私はAngularFire2を使ってリストからリストを取得しようとしています。 * ngFor内 *ネストされたngForはFirebaseAngularFire2ネストされた* ngFor Array内の配列...しかしFirebaseは配列を持っていません...?
のビューに...app.componnent
...
constructor(private _af: AngularFire) {
this.lists = this._af.database.list(this._API_URL);
}
...
app.component.html
<div *ngFor="let list of lists | async">
{{sublist.name}}<br/> <!-- I can see you -->
<!--******* I can't see you **********-->
<div *ngFor="let rootword of list.rootwords">
{{rootword.word}} {{rootword.total}}
</div>
</div>
例を示していません
maindb
|_list1
| |_name: 'List 1"
| |_rootwords
| |_apple
| | |_word: 'apple'
| | |_total: 4
| |
| |_banana
| | |_word: 'banana'
| | |_total: 2
| |_carpet
| | |_word: 'carpet'
| | |_total: 21
|
|_list2
|_name: "List 2"
|_rootwords
|_elephant
| |_word: 'elephant'
| |_total: 4
|_sloth
|_word: 'sloth
|_total: 5
ngForをngForにネストする方法は、firebase.listですか? マップやフィルタリングは必要ですか? AngularFire2は内部オブジェクトを配列に変換する方法がありますか?
すべての提案が高く評価されました。
は動作しませんでした。.. 。... itemで始まり、エラーが発生するProperty Assignment expected ..この構文を使用するには別のrxjsをインポートする必要がありますか? これをコメントアウトしても、まだエラーが発生します: ViewWrappedError エラー:./LearnComponentクラスでエラーが発生しました。LearnComponent - インラインテンプレート:19:17原因:無効な引数 '[オブジェクトオブジェクト]、[オブジェクトオブジェクト]、[オブジェクトオブジェクト] 、[オブジェクトオブジェクト]、[オブジェクトオブジェクト]、[オブジェクトオブジェクト]、... 'パイプ' AsyncPipe 'の ViewWrappedError.ZoneAwareError(http:// localhost:4200/polyfills.bundle.js:1150:33) ViewWrappedError.BaseError [as constructor] ... –
コメントアウト2番目| async、now Error - プロパティの割り当てが必要です。まだ...によって引き起こされるアイテム –
どのタイプのTypeScriptを使用していますか? – cartant