refactor(compiler): minor cleanup
This commit is contained in:
@ -7,9 +7,12 @@
|
||||
*/
|
||||
|
||||
|
||||
import {INTERNAL_SERVER_PLATFORM_PROVIDERS} from './server';
|
||||
import {INTERNAL_SERVER_PLATFORM_PROVIDERS, SERVER_RENDER_PROVIDERS} from './server';
|
||||
|
||||
export var __platform_server_private__:
|
||||
{INTERNAL_SERVER_PLATFORM_PROVIDERS: typeof INTERNAL_SERVER_PLATFORM_PROVIDERS} = {
|
||||
INTERNAL_SERVER_PLATFORM_PROVIDERS: INTERNAL_SERVER_PLATFORM_PROVIDERS
|
||||
};
|
||||
export var __platform_server_private__: {
|
||||
INTERNAL_SERVER_PLATFORM_PROVIDERS: typeof INTERNAL_SERVER_PLATFORM_PROVIDERS,
|
||||
SERVER_RENDER_PROVIDERS: typeof SERVER_RENDER_PROVIDERS,
|
||||
} = {
|
||||
INTERNAL_SERVER_PLATFORM_PROVIDERS: INTERNAL_SERVER_PLATFORM_PROVIDERS,
|
||||
SERVER_RENDER_PROVIDERS: SERVER_RENDER_PROVIDERS,
|
||||
};
|
||||
|
@ -13,7 +13,7 @@ export var DomAdapter: typeof _.DomAdapter = _.DomAdapter;
|
||||
export var setRootDomAdapter: typeof _.setRootDomAdapter = _.setRootDomAdapter;
|
||||
export var getDOM: typeof _.getDOM = _.getDOM;
|
||||
export var SharedStylesHost: typeof _.SharedStylesHost = _.SharedStylesHost;
|
||||
export type SharedStylesHost = typeof _.SharedStylesHost;
|
||||
export type SharedStylesHost = typeof _._SharedStylesHost;
|
||||
export var NAMESPACE_URIS: typeof _.NAMESPACE_URIS = _.NAMESPACE_URIS;
|
||||
export var shimContentAttribute: typeof _.shimContentAttribute = _.shimContentAttribute;
|
||||
export var shimHostAttribute: typeof _.shimHostAttribute = _.shimHostAttribute;
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
import {PlatformLocation} from '@angular/common';
|
||||
import {platformCoreDynamic} from '@angular/compiler';
|
||||
import {NgModule, PLATFORM_INITIALIZER, PlatformRef, Provider, RootRenderer, createPlatformFactory, isDevMode, platformCore} from '@angular/core';
|
||||
import {Injectable, NgModule, PLATFORM_INITIALIZER, PlatformRef, Provider, RootRenderer, createPlatformFactory, isDevMode, platformCore} from '@angular/core';
|
||||
import {BrowserModule} from '@angular/platform-browser';
|
||||
|
||||
import {Parse5DomAdapter} from './parse5_adapter';
|
||||
@ -53,7 +53,8 @@ export function _createConditionalRootRenderer(rootRenderer: any) {
|
||||
export const SERVER_RENDER_PROVIDERS: Provider[] = [
|
||||
ServerRootRenderer,
|
||||
{provide: RootRenderer, useFactory: _createConditionalRootRenderer, deps: [ServerRootRenderer]},
|
||||
{provide: SharedStylesHost, useClass: SharedStylesHost},
|
||||
// use plain SharedStylesHost, not the DomSharedStylesHost
|
||||
SharedStylesHost
|
||||
];
|
||||
|
||||
/**
|
||||
@ -61,7 +62,7 @@ export const SERVER_RENDER_PROVIDERS: Provider[] = [
|
||||
*
|
||||
* @experimental
|
||||
*/
|
||||
@NgModule({imports: [BrowserModule], providers: SERVER_RENDER_PROVIDERS})
|
||||
@NgModule({exports: [BrowserModule], providers: SERVER_RENDER_PROVIDERS})
|
||||
export class ServerModule {
|
||||
}
|
||||
|
||||
|
@ -128,6 +128,8 @@ export class ServerRenderer implements Renderer {
|
||||
destroyView(hostElement: any, viewAllNodes: any[]) {}
|
||||
|
||||
listen(renderElement: any, name: string, callback: Function): Function {
|
||||
// Note: We are not using the EventsPlugin here as this is not needed
|
||||
// to run our tests.
|
||||
var outsideHandler = (event: any) => this._zone.runGuarded(() => callback(event));
|
||||
return this._zone.runOutsideAngular(
|
||||
() => getDOM().onAndCancel(renderElement, name, outsideHandler));
|
||||
|
Reference in New Issue
Block a user