Skip to content

Commit

Permalink
yarn ng generate @angular/core:control-flow
Browse files Browse the repository at this point in the history
  • Loading branch information
kasaharu committed Nov 15, 2023
1 parent a3cb034 commit 9797f6b
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<app-page-title [title]="'Activity'"></app-page-title>

<nav mat-tab-nav-bar>
<ng-container *ngFor="let category of categories">
@for (category of categories; track category) {

<a mat-tab-link [active]="activeLink === category.key" [routerLink]="category.key">{{ category.label }}</a>
</ng-container>

}
</nav>

<router-outlet></router-outlet>
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

<p>はてなブログに投稿された最新の 30 件を表示</p>

<div class="feed-wrapper" *ngIf="articles$ | async as articles">
<ng-container *ngFor="let article of articles">
@if (articles$ | async; as articles) {
<div class="feed-wrapper">
@for (article of articles; track article) {

<app-article [feedItem]="article"></app-article>
</ng-container>

}
</div>
}
6 changes: 4 additions & 2 deletions src/app/features/blog/ui/article/article.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
<p class="blog-item-date">{{ feedItem.publishDate | date : 'yyyy/MM/dd' }}</p>
<a class="blog-item-link" href="{{ feedItem.link }}" target="_blank" rel="noopener">{{ feedItem.title }}</a>
<ul class="category">
<ng-container *ngFor="let category of feedItem.categories">
@for (category of feedItem.categories; track category) {

<li class="category-item">{{ category }}</li>
</ng-container>

}
</ul>
</div>
6 changes: 4 additions & 2 deletions src/app/features/lab/pages/lab/lab.component.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<app-page-title [title]="'Labs'"></app-page-title>

<ng-container *ngFor="let content of labsContents">
@for (content of labsContents; track content) {

<app-card
[title]="content.title"
[demoPageUrl]="content.demoPageUrl"
[repositoryName]="content.repositoryName"
[repositoryUrl]="content.repositoryUrl"
></app-card>
</ng-container>

}
8 changes: 6 additions & 2 deletions src/app/features/top/containers/top/top.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
<img src="assets/images/profile.jpg" width="200" height="200" alt="" />

<ul class="information">
<li class="list-item" *ngFor="let myInfo of myInfoList">{{ myInfo }}</li>
<li class="list-item" *ngFor="let sns of snsList">
@for (myInfo of myInfoList; track myInfo) {
<li class="list-item">{{ myInfo }}</li>
}
@for (sns of snsList; track sns) {
<li class="list-item">
<a appExternalLink href="{{ sns.url }}">{{ sns.serviceName }}</a>
</li>
}
</ul>
</div>
8 changes: 6 additions & 2 deletions src/app/shared/card/card/card.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<div class="card">
<div class="card-title">{{ title }}</div>
<div class="external-links">
<a *ngIf="demoPageUrl" class="link" appExternalLink href="{{ demoPageUrl }}">demo</a>
<a *ngIf="repositoryUrl" class="link" appExternalLink href="{{ repositoryUrl }}">GitHub - {{ repositoryName }}</a>
@if (demoPageUrl) {
<a class="link" appExternalLink href="{{ demoPageUrl }}">demo</a>
}
@if (repositoryUrl) {
<a class="link" appExternalLink href="{{ repositoryUrl }}">GitHub - {{ repositoryName }}</a>
}
</div>
</div>

0 comments on commit 9797f6b

Please sign in to comment.