Skip to content

Commit

Permalink
fix(modal): add class name to modal
Browse files Browse the repository at this point in the history
fixes #7000
  • Loading branch information
brandyscarney committed Jun 21, 2016
1 parent ae40edf commit 6e34739
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
4 changes: 3 additions & 1 deletion src/components/modal/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ export class ModalCmp {
this._compiler.resolveComponent(componentType).then((componentFactory) => {
let componentRef = this.viewport.createComponent(componentFactory, this.viewport.length, this.viewport.parentInjector);
this._renderer.setElementClass(componentRef.location.nativeElement, 'show-page', true);
this._renderer.setElementClass(componentRef.location.nativeElement, componentType.name, true);
// auto-add page css className created from component JS class name
let cssClassName = pascalCaseToDashCase(componentType.name);
this._renderer.setElementClass(componentRef.location.nativeElement, cssClassName, true);
this._viewCtrl.setInstance(componentRef.instance);
this.enabled = true;
done();
Expand Down
17 changes: 8 additions & 9 deletions src/components/modal/test/basic/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Component} from '@angular/core';
import {ionicBootstrap, Config, Platform} from '../../../../../src';
import {Modal, ActionSheet, NavController, NavParams, PageTransition, TransitionOptions, ViewController} from '../../../../../src';
import { Component } from '@angular/core';

import { ActionSheet, Config, ionicBootstrap, Modal, NavController, NavParams, PageTransition, Platform, TransitionOptions, ViewController } from '../../../../../src';

@Component({
templateUrl: 'main.html'
Expand All @@ -25,7 +25,7 @@ class E2EPage {
console.log('android', platform.is('android'));
console.log('windows phone', platform.is('windows'));

platform.ready().then((readySource) => {
platform.ready().then((readySource: string) => {
console.log('platform.ready, readySource:', readySource);
});

Expand Down Expand Up @@ -73,7 +73,6 @@ class E2EPage {
presentNavigableModal(){
let modal = Modal.create(NavigableModal);
this.nav.present(modal);
//this.nav.push(NavigableModal);
}
}

Expand All @@ -90,8 +89,8 @@ class E2EPage {
</ion-content>
`
})
class NavigableModal{
constructor(private navController:NavController){
class NavigableModal {
constructor(private navController:NavController) {
}

submit(){
Expand All @@ -112,8 +111,8 @@ class NavigableModal{
</ion-content>
`
})
class NavigableModal2{
constructor(private navController:NavController){
class NavigableModal2 {
constructor(private navController:NavController) {
}

submit(){
Expand Down

0 comments on commit 6e34739

Please sign in to comment.