roo*_*z11 0 typescript angular-providers angular ng-build
当我运行我的 Angular 8 应用程序的 prod 版本时,我在控制台中收到此错误。构建运行良好,我已经在我的提供者中包含了所有服务。
我已经运行了以下命令,但没有收到任何错误。
ng build --prod --optimization=false
有什么办法可以判断什么是失败的?即使我注释掉所有提供程序(预计构建失败),我仍然没有收到任何错误。
请让我知道我可以/应该提供哪些其他信息来帮助您。谢谢!
app.module.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpClientModule, HTTP_INTERCEPTORS, HttpClient } from '@angular/common/http';
import { RouterModule } from '@angular/router';
import { AppComponent } from './app.component';
import { HomeComponent } from './home/home.component';
import { NavMenuComponent } from './nav-menu/nav-menu.component';
//a bunch more components...
import { AccountModule } from './account/account.module';
import { AccountRoutingModule } from './account/account.routing.module';
import { AuthGuard } from './helpers/auth.guard';
import { ErrorInterceptor } from './helpers/error.interceptor';
import { JwtInterceptor } from './helpers/jwt.interceptor';
import { TemplateService } from './services/template.service';
import { ExerciseService } from './services/exercise.service';
import { ExamService } from './services/exam.service';
import { AuthService } from './services/auth.service';
import { FeatureService } from './services/feature.service';
import { RoleService } from './services/role.service';
import { UserService } from './services/user.service';
@NgModule({
declarations: [
AppComponent,
NavMenuComponent,
HomeComponent,
],
imports: [
BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }),
HttpClientModule,
FormsModule,
ReactiveFormsModule,
BrowserAnimationsModule,
AccountModule,
AccountRoutingModule,
RouterModule.forRoot([
{ path: '', component: HomeComponent, canActivate: [AuthGuard] },
//all routes left out for brevity
])
],
//entryComponents: [NewTemplateModal, NewExerciseModal, AddFeaturesModal, SaveSuccessComponent, ErrorComponent],
providers: [
AuthService,
ExamService,
ExerciseService,
FeatureService,
RoleService,
TemplateService,
UserService,
HttpClient,
{ provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true },
{ provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true },
],
bootstrap: [AppComponent]
})
export class AppModule { }
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
5933 次 |
最近记录: |