使用 Angular 和 Angular Material 重写 MediaMan
1. 将组件添加到页面
为了开始使用组件,需要对 book-page.component.html
模板进行调整,以下是修改后的代码:
<h2>Book collections</h2>
<div class="collectionContainerGroup">
<div class="containerGroup">
<div class="container">
<h3>New collection</h3>
<form id="newBookCollection" action="#">
<div>
<input type="text" [formControl]="formControl" title="Name"
placeholder="Name" required />
<div *ngIf="formControl.invalid && (formControl.dirty ||
formControl.touched)"
class="alert alert-danger">
<span *ngIf="formControl.hasError('required')"&