我有以下Angular app.component.ts文件
import {NgModule} from '@angular/core';
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'blog';
}
我需要在app.component.ts中导入表单模块,然后如何执行以下html文件
<h1>What is Module in Angular</h1>
<form #simpleForm="ngForm" (ngSubmit)="getValues(simpleForm.value)">
<input type="text" ngModel name="user" placeholder="enter user name">
<br><br>
<input type="text" ngModel name="age" placeholder="enter user age">
<br><br>
<input type="text" ngModel name="address" placeholder="enter user address">
<br><br>
<input type="password" ngModel name="password" placeholder="enter user password">
<br><br>
<button>Get User Values</button>
</form>