From 5297c9d9ccc6f8831d1656915e3d78e767022517 Mon Sep 17 00:00:00 2001 From: Tobias Bosch Date: Fri, 29 Apr 2016 01:34:06 -0700 Subject: [PATCH] refactor(core): deprecate `DynamicComponentLoader` and `DebugNode.inject` BREAKING CHANGE: - `DynamicComponentLoader` is deprecated. Use `ComponentResolver` and `ViewContainerRef` directly. - `DebugNode.inject` is deprecated. use `DebugNode.injector.get` instead. --- modules/angular2/src/core/debug/debug_node.ts | 5 +++++ modules/angular2/src/core/linker/dynamic_component_loader.ts | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/angular2/src/core/debug/debug_node.ts b/modules/angular2/src/core/debug/debug_node.ts index 138b30266a..f998b651c8 100644 --- a/modules/angular2/src/core/debug/debug_node.ts +++ b/modules/angular2/src/core/debug/debug_node.ts @@ -38,6 +38,11 @@ export class DebugNode { get source(): string { return isPresent(this._debugInfo) ? this._debugInfo.source : null; } + /** + * Use injector.get(token) instead. + * + * @deprecated + */ inject(token: any): any { return this.injector.get(token); } } diff --git a/modules/angular2/src/core/linker/dynamic_component_loader.ts b/modules/angular2/src/core/linker/dynamic_component_loader.ts index 6b6014aafe..5aa890645d 100644 --- a/modules/angular2/src/core/linker/dynamic_component_loader.ts +++ b/modules/angular2/src/core/linker/dynamic_component_loader.ts @@ -10,7 +10,9 @@ import {ComponentRef} from './component_factory'; import {ViewContainerRef} from './view_container_ref'; /** - * Service for instantiating a Component and attaching it to a View at a specified location. + * Use ComponentResolver and ViewContainerRef directly. + * + * @deprecated */ export abstract class DynamicComponentLoader { /**