相关疑难解决方法(0)

在Angular 4中的子模块中使用AppModule中的组件

我已经在LoadingComponent我的应用程序的根目录中创建了一个小的component()并且(显然)在我的应用程序中声明了它AppModule.我的应用程序加载时会使用此组件,并应显示一些奇特的加载动画.

现在我想在保存一些东西时在子模块中使用它.但是当我想在另一个模块中使用这个组件时,我总是会遇到错误.

我在AppModule中导出了LoadingComponent:

import { ButtonsModule } from './buttons/buttons.module';
import { FormsModule } from '@angular/forms';
import { StatusLightsDisplayComponent } from './status-lights-display/status-lights-display.component';
import { StatusLightsContainerComponent } from './status-lights-container/status-lights-container.component';
import { HttpModule } from '@angular/http';
import { ReportsService } from './services/reports.service';
import { BrowserModule } from '@angular/platform-browser';
import { forwardRef, NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { GeneralInformationComponent } from './general-information/general-information.component';
import { TextfieldsComponent } from './textfields/textfields.component';
import { LoadingComponent } from './loading/loading.component'; …
Run Code Online (Sandbox Code Playgroud)

angular-module angular

7
推荐指数
2
解决办法
9737
查看次数

标签 统计

angular ×1

angular-module ×1