fix(platform-server): don't setup Testability and TestabilityRegistry on the server (#14510)
This commit is contained in:
@ -433,9 +433,7 @@ export class ApplicationRef_ extends ApplicationRef {
|
|||||||
private _zone: NgZone, private _console: Console, private _injector: Injector,
|
private _zone: NgZone, private _console: Console, private _injector: Injector,
|
||||||
private _exceptionHandler: ErrorHandler,
|
private _exceptionHandler: ErrorHandler,
|
||||||
private _componentFactoryResolver: ComponentFactoryResolver,
|
private _componentFactoryResolver: ComponentFactoryResolver,
|
||||||
private _initStatus: ApplicationInitStatus,
|
private _initStatus: ApplicationInitStatus) {
|
||||||
@Optional() private _testabilityRegistry: TestabilityRegistry,
|
|
||||||
@Optional() private _testability: Testability) {
|
|
||||||
super();
|
super();
|
||||||
this._enforceNoNewChanges = isDevMode();
|
this._enforceNoNewChanges = isDevMode();
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
import {PlatformLocation, ɵPLATFORM_SERVER_ID as PLATFORM_SERVER_ID} from '@angular/common';
|
import {PlatformLocation, ɵPLATFORM_SERVER_ID as PLATFORM_SERVER_ID} from '@angular/common';
|
||||||
import {platformCoreDynamic} from '@angular/compiler';
|
import {platformCoreDynamic} from '@angular/compiler';
|
||||||
import {Injectable, InjectionToken, Injector, NgModule, PLATFORM_ID, PLATFORM_INITIALIZER, PlatformRef, Provider, RendererFactoryV2, RootRenderer, createPlatformFactory, isDevMode, platformCore, ɵALLOW_MULTIPLE_PLATFORMS as ALLOW_MULTIPLE_PLATFORMS} from '@angular/core';
|
import {Injectable, InjectionToken, Injector, NgModule, PLATFORM_ID, PLATFORM_INITIALIZER, PlatformRef, Provider, RendererFactoryV2, RootRenderer, Testability, createPlatformFactory, isDevMode, platformCore, ɵALLOW_MULTIPLE_PLATFORMS as ALLOW_MULTIPLE_PLATFORMS} from '@angular/core';
|
||||||
import {HttpModule} from '@angular/http';
|
import {HttpModule} from '@angular/http';
|
||||||
import {BrowserModule, DOCUMENT, ɵSharedStylesHost as SharedStylesHost, ɵgetDOM as getDOM} from '@angular/platform-browser';
|
import {BrowserModule, DOCUMENT, ɵSharedStylesHost as SharedStylesHost, ɵgetDOM as getDOM} from '@angular/platform-browser';
|
||||||
|
|
||||||
@ -52,7 +52,11 @@ export const SERVER_RENDER_PROVIDERS: Provider[] = [
|
|||||||
@NgModule({
|
@NgModule({
|
||||||
exports: [BrowserModule],
|
exports: [BrowserModule],
|
||||||
imports: [HttpModule],
|
imports: [HttpModule],
|
||||||
providers: [SERVER_RENDER_PROVIDERS, SERVER_HTTP_PROVIDERS],
|
providers: [
|
||||||
|
SERVER_RENDER_PROVIDERS,
|
||||||
|
SERVER_HTTP_PROVIDERS,
|
||||||
|
{provide: Testability, useValue: null},
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class ServerModule {
|
export class ServerModule {
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user