feat(action-sheet): add ability to pass multiple classes to cssClass

references #7618
This commit is contained in:
Brandy Carney
2016-08-09 16:13:27 -04:00
parent a685cdc4af
commit 68ab2618d3
2 changed files with 14 additions and 3 deletions

View File

@ -47,7 +47,14 @@ import { ViewController } from '../nav/view-controller';
encapsulation: ViewEncapsulation.None, encapsulation: ViewEncapsulation.None,
}) })
export class ActionSheetCmp { export class ActionSheetCmp {
private d: any; private d: {
title?: string;
subTitle?: string;
cssClass?: string;
buttons?: Array<any>;
enableBackdropDismiss?: boolean;
cancelButton: any;
};
private descId: string; private descId: string;
private enabled: boolean; private enabled: boolean;
private hdrId: string; private hdrId: string;
@ -64,7 +71,10 @@ export class ActionSheetCmp {
this.d = params.data; this.d = params.data;
if (this.d.cssClass) { if (this.d.cssClass) {
renderer.setElementClass(_elementRef.nativeElement, this.d.cssClass, true); this.d.cssClass.split(' ').forEach(cssClass => {
// Make sure the class isn't whitespace, otherwise it throws exceptions
if (cssClass.trim() !== '') renderer.setElementClass(_elementRef.nativeElement, cssClass, true);
});
} }
this.id = (++actionSheetIds); this.id = (++actionSheetIds);

View File

@ -96,7 +96,8 @@ class E2EPage {
this.result = 'Destructive'; this.result = 'Destructive';
} }
} }
] ],
cssClass: 'my-action-sheet another-action-sheet-class'
}); });
actionSheet.present(actionSheet); actionSheet.present(actionSheet);