Включен ли модуль платформы (BrowserModule)?

Я использую шаблон SmartAdmin с платформой Angular 5.x. Когда я казнил (ng serve) приложение. Он работает успешно, но я получил ошибку на консоли разработчика. То есть:

Error: Uncaught (in promise): Error: No ErrorHandler. Is platform module (BrowserModule) included?
Error: No ErrorHandler. Is platform module (BrowserModule) included?
    at eval (core.js:5374)
    at ZoneDelegate.invoke (zone.js:392)
    at Object.onInvoke (core.js:4630)
    at ZoneDelegate.invoke (zone.js:391)
    at Object.onInvoke (core.js:4630)
    at ZoneDelegate.invoke (zone.js:391)
    at Zone.run (zone.js:142)
    at NgZone.run (core.js:4447)
    at PlatformRef.bootstrapModuleFactory (core.js:5369)
    at eval (core.js:5448)
    at eval (core.js:5374)
    at ZoneDelegate.invoke (zone.js:392)
    at Object.onInvoke (core.js:4630)
    at ZoneDelegate.invoke (zone.js:391)
    at Object.onInvoke (core.js:4630)
    at ZoneDelegate.invoke (zone.js:391)
    at Zone.run (zone.js:142)
    at NgZone.run (core.js:4447)
    at PlatformRef.bootstrapModuleFactory (core.js:5369)
    at eval (core.js:5448)
    at resolvePromise (zone.js:824)
    at eval (zone.js:876)
    at ZoneDelegate.invokeTask (zone.js:425)
    at Object.onInvokeTask (core.js:4621)
    at ZoneDelegate.invokeTask (zone.js:424)
    at Zone.runTask (zone.js:192)
    at drainMicroTaskQueue (zone.js:602)
    at <anonymous>

Я уже добавил BrowserModule внутри импорта app.module.ts

import { NgModule, ApplicationRef } from '@angular/core';
    import { BrowserModule } from '@angular/platform-browser';
    import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

    import { FormsModule } from '@angular/forms';

    import { routing } from './app.routing'

    import { AppComponent } from './app.component';
    import { APP_RESOLVER_PROVIDERS } from './app.resolver';
    import { AppState, InternalStateType } from './app.service';


    import {CoreModule} from "./core/core.module";
    import {SmartadminLayoutModule} from "./shared/layout/layout.module";

    import { ModalModule } from 'ngx-bootstrap/modal';

    const APP_PROVIDERS = [
      ...APP_RESOLVER_PROVIDERS,
      AppState
    ];

    type StoreType = {
      state: InternalStateType,
      restoreInputValues: () => void,
      disposeOldHosts: () => void
    };

    @NgModule({
      bootstrap: [ AppComponent ],
      declarations: [
        AppComponent,

      ],
      imports: [ 
        BrowserModule,
        BrowserAnimationsModule,
        FormsModule,
        ModalModule.forRoot(),
        CoreModule,
        SmartadminLayoutModule,
        routing
      ],
      exports: [
      ],
      providers: [ 
        APP_PROVIDERS
      ]
    })
    export class AppModule {
      constructor(public appRef: ApplicationRef, public appState: AppState) {}
    }

0 ответов

Другие вопросы по тегам