1
我是新角度。我在Visual Studio Code中工作。输入框不显示在角
我app.component.html看起来是这样的:
<input type="text" [(ngModel)]="name">
<p>{{ name }}</p>
我app.component.ts看起来是这样的:
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
name = '';
}
我的问题是,在输入框中没有在显示浏览器http://localhost:4200/
它给这个错误: –
无法编译。 C:/Users/Dell/my-first-app/src/app/app.module.ts(14,5):找不到名字'ProfileListComponent'。 –
@Boidurja ProfileListComponent是Shashi代码的示例,因此您不需要添加ProfileListComponent ...添加组件并将FormsModule导入模块文件 – Chandru