forked from devshawn/lab3-setup
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to new Angular control flow tools
This used the built-in `ng generate @angular/core:control-flow` to migrate to using the new control flow tools. I also fixed a couple of oddities that I noticed when I ran this on the iteration template.
- Loading branch information
Showing
4 changed files
with
86 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
<mat-card appearance="outlined" class="user-card" *ngIf="this.user"> | ||
<mat-card-header> | ||
<img mat-card-avatar [src]="this.user.avatar" alt="Avatar for {{this.user.name}}" class="user-avatar" *ngIf="this.user.avatar"> | ||
<mat-card-title class="user-card-name">{{ this.user.name }}</mat-card-title> | ||
<mat-card-subtitle class="user-card-company">{{ this.user.company }}</mat-card-subtitle> | ||
</mat-card-header> | ||
<mat-card-content *ngIf="!this.simple"> | ||
<p>Role: <span class="user-card-role">{{ this.user.role }}</span></p> | ||
<p>Age: <span class="user-card-age">{{ this.user.age }}</span></p> | ||
<p>Email: <a href="mailto:{{this.user.email}}" class="user-card-email">{{this.user.email}}</a></p> | ||
</mat-card-content> | ||
<mat-card-actions> | ||
<button mat-button data-test="viewProfileButton" *ngIf="this.simple" [routerLink]="['/users', this.user._id]">View Profile</button> | ||
</mat-card-actions> | ||
@if (this.user) { | ||
<mat-card appearance="outlined" class="user-card"> | ||
<mat-card-header> | ||
@if (this.user.avatar) { | ||
<img mat-card-avatar [src]="this.user.avatar" alt="Avatar for {{this.user.name}}" class="user-avatar"> | ||
} | ||
<mat-card-title class="user-card-name">{{ this.user.name }}</mat-card-title> | ||
<mat-card-subtitle class="user-card-company">{{ this.user.company }}</mat-card-subtitle> | ||
</mat-card-header> | ||
@if (!this.simple) { | ||
<mat-card-content> | ||
<p>Role: <span class="user-card-role">{{ this.user.role }}</span></p> | ||
<p>Age: <span class="user-card-age">{{ this.user.age }}</span></p> | ||
<p>Email: <a href="mailto:{{this.user.email}}" class="user-card-email">{{this.user.email}}</a></p> | ||
</mat-card-content> | ||
} | ||
@if (this.simple) { | ||
<mat-card-actions> | ||
<button mat-button data-test="viewProfileButton" [routerLink]="['/users', this.user._id]">View Profile</button> | ||
</mat-card-actions> | ||
} | ||
</mat-card> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters