Creating shared components
Here’s a minimal implementation of the <app-view-user>
directive, a prerequisite for the Review step.
Create a new viewUser
component under the user
folder structure, as follows:
src/app/user/view-user/view-user.component.ts
import { AsyncPipe, DatePipe } from '@angular/common'
import {
Component, inject, Input, OnChanges, SimpleChanges
} from '@angular/core'
import { MatButtonModule } from '@angular/material/button'
import { MatCardModule } from '@angular/material/card'
import { MatIconModule } from '@angular/material/icon'
import { Router } from '@angular/router'
import { IUser, User } from '../user/user'
@Component({
selector: 'app-view-user',
template: `
@if (currentUser) {
<div>
<mat-card appearance="outlined">
<mat-card-header>
<div mat-card-avatar>
<mat...