refactor(core): cleanup unused `NgZone` factory

This factory was only used when using `coreBootstrap` / `coreLoadAndBoostrap`
which is not supported any more.
This commit is contained in:
Tobias Bosch 2016-07-29 04:46:52 -07:00
parent 251953218c
commit 633c7d1ebe
1 changed files with 0 additions and 19 deletions

View File

@ -18,7 +18,6 @@ import {ComponentResolver} from './linker/component_resolver';
import {DynamicComponentLoader, DynamicComponentLoader_} from './linker/dynamic_component_loader'; import {DynamicComponentLoader, DynamicComponentLoader_} from './linker/dynamic_component_loader';
import {ViewUtils} from './linker/view_utils'; import {ViewUtils} from './linker/view_utils';
import {NgModule} from './metadata'; import {NgModule} from './metadata';
import {NgZone} from './zone/ng_zone';
let __unused: Type; // avoid unused import when Type union types are erased let __unused: Type; // avoid unused import when Type union types are erased
@ -30,19 +29,6 @@ export function _keyValueDiffersFactory() {
return defaultKeyValueDiffers; return defaultKeyValueDiffers;
} }
export function createNgZone(parent: NgZone): NgZone {
// If an NgZone is already present in the parent injector,
// use that one. Creating the NgZone in the same injector as the
// application is dangerous as some services might get created before
// the NgZone has been created.
// We keep the NgZone factory in the application providers for
// backwards compatibility for now though.
if (parent) {
return parent;
}
return new NgZone({enableLongStackTrace: isDevMode()});
}
/** /**
* A default set of providers which should be included in any Angular * A default set of providers which should be included in any Angular
* application, regardless of the platform it runs onto. * application, regardless of the platform it runs onto.
@ -59,11 +45,6 @@ export const APPLICATION_COMMON_PROVIDERS: Array<Type|{[k: string]: any}|any[]>
*/ */
@NgModule({ @NgModule({
providers: [ providers: [
{
provide: NgZone,
useFactory: createNgZone,
deps: <any>[[new SkipSelfMetadata(), new OptionalMetadata(), NgZone]]
},
ApplicationRef_, ApplicationRef_,
{provide: ApplicationRef, useExisting: ApplicationRef_}, {provide: ApplicationRef, useExisting: ApplicationRef_},
Compiler, Compiler,