0
あああああああああなぜ.........Angular2 - 後で到着するデータを表示する方法
私のgit_list配列は後で到着します。非同期を使用するとエラーが発生するのはなぜですか?非同期を使用しないと、データが到着したときにデータが表示されません。
EXCEPTION: Uncaught (in promise): Error: Error in ./GitaccountsComponent class GitaccountsComponent - inline template:26:17 caused by: Invalid argument '' for pipe 'AsyncPipe'
Error: Invalid argument '' for pipe 'AsyncPipe'
<md-grid-tile *ngFor="let item of git_list | async" [colspan]="1" [rowspan]="1">
</md-grid-tile>
git_list = [
{
"git_account": "gggggggggg",
"git_host": "bitbucket"
},
{
"git_account": "yiofysdgsdgfs",
"git_host": "bitbucket"
},
{
"git_account": "yyyyyyyy",
"git_host": "bitbucket"
},
{
"git_account": "TTTTT",
"git_host": "github"
}
]
ts/jsに 'git_list'の割り当て行を追加できますか? – echonax
ngIf、つまり、 'を追加しようとしましたか? –
AngularChef
'| async'は後で到着するデータではなく、 'Observable'または' Promise'のデータのみです。 'git_list'が' Observable'や 'Promise'でない場合、' | async'は動作しません。 –