From 975afea6a77c192006cce4ec5a831d3506fbcb52 Mon Sep 17 00:00:00 2001 From: "Shlomi Assaf (shlassaf)" Date: Tue, 30 Aug 2016 17:23:42 +0300 Subject: [PATCH] refactor: `CSSDialogContainer` support for `ContainerContent` (support string, TepmlateRef and Components as content) BREAKING CHANGE: method `CSSDialogContainer.addComponent()` was removed since modal containers are based on `ng-content`. Also removed the bindings for `tabindex` and `role`, they are now static --- .../components/css-dialog-container.ts | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/components/angular2-modal/components/css-dialog-container.ts b/src/components/angular2-modal/components/css-dialog-container.ts index 5e162316..2f93b1d1 100644 --- a/src/components/angular2-modal/components/css-dialog-container.ts +++ b/src/components/angular2-modal/components/css-dialog-container.ts @@ -19,26 +19,17 @@ import { Class } from '../framework/utils'; @Component({ selector: 'css-dialog-container', host: { - '[attr.tabindex]': 'tabIndex', - '[attr.role]': 'role' + 'tabindex': '-1', + 'role': 'dialog' }, encapsulation: ViewEncapsulation.None, - template: `` + template: `` }) export class CSSDialogContainer extends BaseDynamicComponent { - tabIndex: number = -1; - role: string = 'dialog'; - - @ViewChild('modalDialog', {read: ViewContainerRef}) private vcRef: ViewContainerRef; constructor(public dialog: DialogRef, el: ElementRef, renderer: Renderer) { super(el, renderer); this.activateAnimationListener(); } - - addComponent(type: Class, bindings?: ResolvedReflectiveProvider[]): ComponentRef { - return super._addComponent(type, this.vcRef, bindings); - } - }