title: How can I dynamically create a modal with a specific class in Ionic 2?
body: <p>Hi I have been stuck with a problem for days now, and so far no research has proved sufficient. I am trying to create a simple modal in Ionic 2 with a specific class (or id). </p>
  
  <p>I need something as simple as this:</p>
  
  <pre><code>&lt;ion-modal class="myDifficultToAddClass"&gt;
  ...
  &lt;/ion-modal&gt;
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>import { NavParams, ModalController } from 'ionic-angular';
  @Component(...)
  class PageBehindTheModal {
    constructor(public modalCtrl: ModalController) {
  
    }
    presentProfileModal() {
      let profileModal = this.modalCtrl.create(Profile, { randomData: randomData });
      profileModal.present();
    }
  }
  
  @Component(...)
  class Profile {
    constructor(params: NavParams) {
      console.log('Some info: ', params.get('randomData'));
    }
  }
  </code></pre>
  
  <p>I have tried to encapsulate the view with ViewEncapsulation from angular/core in order to use a local css, but this css will be available globally (and I cannot "style" only this particular modal - so this is not a solution):</p>
  
  <pre><code>import { ViewEncapsulation } from '@angular/core';
  @Component({
    styleUrls: ['./product-details.scss'],
    encapsulation: ViewEncapsulation.Emulated
  })
  </code></pre>
  
  <p>I was hoping to find a simple solution like:</p>
  
  <pre><code>// create(component, data, opts)
  create(Profile, { randomData: randomData }, { cssClass: 'myDifficultToAddClass' })
  </code></pre>
  
  <p>Unfortunately, my wish didn't come true :).</p>
  
  <p>Does anyone know how to do this?</p>