commit df230baf7498ea6077d7330634ed6bd1a7bd82a5 parent 9f6890c284158d361cd0530c3374bc4e15072e3c Author: MTRNord <mtrnord1@gmail.com> Date: Fri, 23 Mar 2018 14:15:56 +0100 Else seems not to work at this ngFor Diffstat:
| M | src/app/tweet-list/tweet-list.component.html | | | 4 | ++-- |
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/app/tweet-list/tweet-list.component.html b/src/app/tweet-list/tweet-list.component.html @@ -1,6 +1,6 @@ <div class="grid"> <ng-container *ngFor="let item of data"> - <app-card *ngIf="item.image_urls; else other" [title]="item.display_name" [image]="item.image_urls[0]" [text]="item.text" [retweet]="item.retweet" [retweets]="item.retweets" [created_at]="item.created_at" [favs]="item.favorites"></app-card> - <app-card #other [title]="item.display_name" [text]="item.text" [retweet]="item.retweet" [retweets]="item.retweets" [created_at]="item.created_at" [favs]="item.favorites"></app-card> + <app-card *ngIf="item.image_urls" [title]="item.display_name" [image]="item.image_urls[0]" [text]="item.text" [retweet]="item.retweet" [retweets]="item.retweets" [created_at]="item.created_at" [favs]="item.favorites"></app-card> + <app-card *ngIf="!item.image_urls" [title]="item.display_name" [text]="item.text" [retweet]="item.retweet" [retweets]="item.retweets" [created_at]="item.created_at" [favs]="item.favorites"></app-card> </ng-container> </div>