feat(loading): add ability to pass multiple classes to cssClass

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

View File

@ -32,7 +32,15 @@ import { ViewController } from '../nav/view-controller';
encapsulation: ViewEncapsulation.None,
})
export class LoadingCmp {
private d: any;
private d: {
spinner?: string;
content?: string;
cssClass?: string;
showBackdrop?: boolean;
dismissOnPageChange?: boolean;
delay?: number;
duration?: number;
};
private id: number;
private showSpinner: boolean;
private durationTimeout: number;
@ -47,7 +55,10 @@ export class LoadingCmp {
this.d = params.data;
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 = (++loadingIds);