Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法识别Angular4导出的成员--错误消息的原因?_Angular_Typescript_Import_Module - Fatal编程技术网

无法识别Angular4导出的成员--错误消息的原因?

无法识别Angular4导出的成员--错误消息的原因?,angular,typescript,import,module,Angular,Typescript,Import,Module,我正在为一个荒诞派戏剧团体创建一个项目,到目前为止,我已经创建了一些代码,并对其进行了重构以用于路由 应用程序组件.ts import { Component } from '@angular/core'; @Component({ selector: 'app', template: ` <h1>{{title}}</h1> <absurdist-drama></absurdist-drama> ` }) expo

我正在为一个荒诞派戏剧团体创建一个项目,到目前为止,我已经创建了一些代码,并对其进行了重构以用于路由

应用程序组件.ts

import { Component } from '@angular/core';

@Component({
  selector: 'app',
  template: `
    <h1>{{title}}</h1>
    <absurdist-drama></absurdist-drama>
  `
})

export class AppComponent {
  title = 'An Archipelago Grapefruit';
}
import { BrowserModule }       from '@angular/platform-browser';
import { NgModule }            from '@angular/core';
import { FormsModule }         from '@angular/forms';
import { HttpModule }          from '@angular/http';
import { RouterModule }        from '@angular/router';

import { AppComponent }        from './app.component';
import { GrapefruitComponent } from './grapefruit.component';

@NgModule({
  declarations: [
    AppComponent,
    GrapefruitComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    RouterModule.forRoot([
  {
    path: 'absurdist-drama',
    component: GrapefruitComponent
  }
])
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
这似乎是应用程序应该可以工作的,它是从本地主机而不是服务器上提供服务的(尽管计算机仍然连接到互联网),所以我没有预料到这一次与安全问题有关,但我得到了错误:

src/app/app.module.ts (7,10): Module '"app/src/app/app.component"' has no exported member 'AppComponent'.

app.component.ts
app.module.ts
位于同一目录中。问题的原因可能是什么?

它没有说找不到模块,而是说没有名为“AppComponent”的导出成员。
导出类AppComponent
我重新启动了服务器进程,现在错误消失了(被更易理解和可操作的错误所取代)所以我猜这只是“其中一件事”…@OmriLuzon绝对没有关系。它没有说模块没有找到,而是说没有名为“AppComponent”的导出成员。
export class AppComponent
我重新启动了服务器进程,现在错误已经消失了(被更容易理解和可操作的错误所取代)所以我猜这只是“其中一件事”…@OmriLuzon绝对没有关系。