0

我是新手,angular在加载页面时遇到问题。有关问题,请参阅屏幕截图。

你好.component.ts:

import { Component, Input } from '@angular/core';
@Component({
  selector: 'hello',
  template: `<h1>Hello {{name}}!</h1>`,
  styles: [`h1 { font-family: Lato; }`]
})
export class HelloComponent  {
  @Input() name: string;
}

在此处输入图像描述

4

1 回答 1

0

您可以首先检查您的模块是否已导入您的组件,如下所示。

@NgModule({
  declarations: [
    ...
    HelloComponent  
  ],
于 2020-03-27T07:55:52.357 回答