2つのボタンがあります(詳細と開く)。詳細ボタンをクリックすると、details.htmlファイルに移動しますが、ここに詳細ページが再び表示されます。別のページに移動するときに詳細ボタンを非表示にしたい。
<button mat-button (click)="onSelectApp(app)"><mat-icon class="mat-icon material-icons">pageview</mat-icon>Detail</button>
<button mat-button (click)="onOpenApp(app.uri)"><mat-icon class="mat-icon material-icons">open_in_new</mat-icon>Open</button>
これがtsコードです。
onSelectApp(app: IApp): void {
if (app.identifier) {
this.router.navigate(['/home/apps', app.identifier]);
} else {
console.error('No appId found');
}
}
ボタンタグの単純なngIfステートメントでボタンを非表示にできるはずです。
<button mat-button *ngIf="!app.identifier" (click)="onSelectApp(app)"><mat-icon class="mat-icon material-
icons">pageview</mat-icon>Detail</button>
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加