Custom component doesn't work in modalController


#1

I can’t figure how to pass custom component to modal. Am I missing something?
version: Ionic version 3.20

It works in html with selector, something like this:
<custom-component></custom-component>

but when I want to pass it to modal it doesn’t work…

import { ModalController, NavParams } from 'ionic-angular';
import {CustomComponent} from '../../components/...';

constructor(public modalCtrl: ModalController) {}

showModal(){
this.modalCtrl.create(CustomComponent,null).present();
}

#2

Hello,
maybe it works, when you pass a page with your custom component inside.

Best regards, anna-liebt