加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angular – 错误:模块导出的意外值’undefined’

发布时间:2020-12-17 08:46:23 所属栏目:安全 来源:网络整理
导读:我正在使用cli构建一个角度4应用程序.我已经创建了一个共享模块并在我的appmodule和moviemodule中导入了该模块.我收到编译时错误未捕获错误:模块’SharedModule’导出的意外值’undefined’ 有人能告诉我问题是什么我仔细检查了语法.我在这里错过了一些东西
我正在使用cli构建一个角度4应用程序.我已经创建了一个共享模块并在我的appmodule和moviemodule中导入了该模块.我收到编译时错误未捕获错误:模块’SharedModule’导出的意外值’undefined’

有人能告诉我问题是什么我仔细检查了语法.我在这里错过了一些东西

错误信息

共享模块

import { NgModule }            from '@angular/core';
import { CommonModule }        from '@angular/common';
import { FormsModule }         from '@angular/forms';
import { GridModule } from '@progress/kendo-angular-grid';


@NgModule({
  imports:      [ CommonModule,GridModule ],exports:      [,CommonModule,FormsModule,GridModule 
                    ]
})
export class SharedModule { }

应用模块

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import {FormsModule} from '@angular/forms';
import {HttpModule} from '@angular/http'
import { AppComponent } from './app.component';
import { NavbarComponent } from './navbar/navbar.component';
import { TopbarComponent } from './topbar/topbar.component';
import { FooterbarComponent } from './footerbar/footerbar.component';
import { MRDBGlobalConstants } from './shared/mrdb.global.constants';
import {AppRoutingModule} from './app.routing';
import {HomeComponent} from './home/home.component';
import {MovieComponent} from './movie/movie.component';
import { MRDBCommonService } from './shared/services/mrdb.common.service';
import { NotFoundComponent } from './not-found/not-found.component';
import { SharedModule } from './shared/shared.module';


@NgModule({
  declarations: [
    AppComponent,FooterbarComponent,TopbarComponent,NavbarComponent,MovieComponent,HomeComponent,NotFoundComponent  
  ],imports: [
    BrowserModule,HttpModule,SharedModule,AppRoutingModule
  ],providers: [MRDBGlobalConstants,MRDBCommonService],bootstrap: [AppComponent]
})
export class AppModule { }

电影模块

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {MovieComponent} from './movie.component';
import { SharedModule }    from '../shared/shared.module';

@NgModule({
  imports: [
       SharedModule
  ],exports: [MovieComponent],declarations: [MovieComponent]
})
export class MovieModule { }
删除CommonModule的逗号前面
exports: [ 
 remove it =>,GridModule 
            ]

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读