- `,
-})
-class ProjectionTestApp {
-}
-
-
-
-const TEST_COMPONENTS = [ProjectionTestApp, ProjectionTestComponent];
-@NgModule({
- imports: [ProjectionModule],
- exports: TEST_COMPONENTS,
- declarations: TEST_COMPONENTS,
- entryComponents: TEST_COMPONENTS,
-})
-class ProjectionTestModule { }
-
diff --git a/src/lib/core/projection/projection.ts b/src/lib/core/projection/projection.ts
deleted file mode 100644
index fb22b8672185..000000000000
--- a/src/lib/core/projection/projection.ts
+++ /dev/null
@@ -1,93 +0,0 @@
-import {Injectable, Directive, ModuleWithProviders, NgModule, ElementRef} from '@angular/core';
-
-
-// "Polyfill" for `Node.replaceWith()`.
-// cf. https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/replaceWith
-function _replaceWith(toReplaceEl: HTMLElement, otherEl: HTMLElement) {
- toReplaceEl.parentElement.replaceChild(otherEl, toReplaceEl);
-}
-
-/** @docs-private */
-@Directive({
- selector: 'cdk-dom-projection-host'
-})
-export class DomProjectionHost {
- constructor(public ref: ElementRef) {}
-}
-
-
-/** @docs-private */
-@Injectable()
-export class DomProjection {
- /**
- * Project an element into a host element.
- * Replace a host element by another element. This also replaces the children of the element
- * by the children of the host.
- *
- * It should be used like this:
- *
- * ```
- * @Component({
- * template: `
- *
- *
other
- *
- *
- *
`
- * })
- * class Cmpt {
- * constructor(private _projector: DomProjection, private _el: ElementRef) {}
- * ngOnInit() { this._projector.project(this._el, this._projector); }
- * }
- * ```
- *
- * This component will move the content of the element it's applied to in the outer div. Because
- * `project()` also move the children of the host inside the projected element, the element will
- * contain the `
other
` HTML as well as its own children.
- *
- * Note: without `` the projection will project an empty element.
- *
- * @param ref ElementRef to be projected.
- * @param host Projection host into which to project the `ElementRef`.
- */
- project(ref: ElementRef, host: DomProjectionHost): void {
- const projectedEl = ref.nativeElement;
- const hostEl = host.ref.nativeElement;
- const childNodes = projectedEl.childNodes;
- let child = childNodes[0];
-
- // We hoist all of the projected element's children out into the projected elements position
- // because we *only* want to move the projected element and not its children.
- _replaceWith(projectedEl, child);
- let l = childNodes.length;
- while (l--) {
- child.parentNode.insertBefore(childNodes[0], child.nextSibling);
- child = child.nextSibling; // nextSibling is now the childNodes[0].
- }
-
- // Insert all host children under the projectedEl, then replace host by component.
- l = hostEl.childNodes.length;
- while (l--) {
- projectedEl.appendChild(hostEl.childNodes[0]);
- }
- _replaceWith(hostEl, projectedEl);
-
- // At this point the host is replaced by the component. Nothing else to be done.
- }
-}
-
-
-/** @docs-private */
-@NgModule({
- exports: [DomProjectionHost],
- declarations: [DomProjectionHost],
- providers: [DomProjection],
-})
-export class ProjectionModule {
- /** @deprecated */
- static forRoot(): ModuleWithProviders {
- return {
- ngModule: ProjectionModule,
- };
- }
-}
diff --git a/src/lib/module.ts b/src/lib/module.ts
index 970cdd5785ea..da1eea31c87c 100644
--- a/src/lib/module.ts
+++ b/src/lib/module.ts
@@ -7,7 +7,6 @@ import {
PortalModule,
OverlayModule,
A11yModule,
- ProjectionModule,
CompatibilityModule,
} from './core/index';
@@ -68,7 +67,6 @@ const MATERIAL_MODULES = [
StyleModule,
A11yModule,
PlatformModule,
- ProjectionModule,
CompatibilityModule,
ObserveContentModule
];
@@ -91,7 +89,6 @@ const MATERIAL_MODULES = [
MdTabsModule.forRoot(),
MdToolbarModule.forRoot(),
PortalModule.forRoot(),
- ProjectionModule.forRoot(),
RtlModule.forRoot(),
ObserveContentModule.forRoot(),