[为什么红色波浪形的错误]
视觉标准中的错误
error screnshot
' “/用户的/ dev / pratice_workspace /快速启动/ SRC /应用/组件/ language.component”' 没有导出的成员'LangugeComponent'。 import LangugeComponent
Chrome控制台错误
ZoneAwareError __zone_symbol__error:错误:(SystemJS)意外 模块'AppModule'声明的值'undefined'错误:意外 模块'AppModule'声明的值'undefined' SyntaxError.ZoneAwareError(
app.module.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { LangugeComponent } from './components/language.component';
@NgModule({
imports: [BrowserModule],
declarations: [AppComponent, LangugeComponent],
bootstrap: [AppComponent]
})
export class AppModule {}
language.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'language',
template: `
<h1>Hello</h1>
`,
})
export class LanguageComponent {
name = 'Sandeep';
designation = 'SE'
}
答案 0 :(得分:2)
您似乎在app.module.ts
import { LangugeComponent } from './components/language.component'
declarations: [AppComponent, LangugeComponent]`
应该是
import { LanguageComponent } from './components/language.component'
declarations: [AppComponent, LanguageComponent]`