Skip to content

Commit 47bdc2b

Browse files
vikermanIgorMinar
authored andcommitted
fix(platform-server): don't setup Testability and TestabilityRegistry on the server (#14510)
1 parent 49b462e commit 47bdc2b

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

modules/@angular/core/src/application_ref.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,7 @@ export class ApplicationRef_ extends ApplicationRef {
433433
private _zone: NgZone, private _console: Console, private _injector: Injector,
434434
private _exceptionHandler: ErrorHandler,
435435
private _componentFactoryResolver: ComponentFactoryResolver,
436-
private _initStatus: ApplicationInitStatus,
437-
@Optional() private _testabilityRegistry: TestabilityRegistry,
438-
@Optional() private _testability: Testability) {
436+
private _initStatus: ApplicationInitStatus) {
439437
super();
440438
this._enforceNoNewChanges = isDevMode();
441439

modules/@angular/platform-server/src/server.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import {PlatformLocation, ɵPLATFORM_SERVER_ID as PLATFORM_SERVER_ID} from '@angular/common';
1010
import {platformCoreDynamic} from '@angular/compiler';
11-
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';
11+
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';
1212
import {HttpModule} from '@angular/http';
1313
import {BrowserModule, DOCUMENT, ɵSharedStylesHost as SharedStylesHost, ɵgetDOM as getDOM} from '@angular/platform-browser';
1414

@@ -52,7 +52,11 @@ export const SERVER_RENDER_PROVIDERS: Provider[] = [
5252
@NgModule({
5353
exports: [BrowserModule],
5454
imports: [HttpModule],
55-
providers: [SERVER_RENDER_PROVIDERS, SERVER_HTTP_PROVIDERS],
55+
providers: [
56+
SERVER_RENDER_PROVIDERS,
57+
SERVER_HTTP_PROVIDERS,
58+
{provide: Testability, useValue: null},
59+
],
5660
})
5761
export class ServerModule {
5862
}

0 commit comments

Comments
 (0)