Reputation: 10887
Is there a way using Ionic to dynamically create a component? For example, I have a few pages where a login prompt should be displayed. I have my component added to my module but don't know where I should go next in order to get this to display when certain events are called.
Any help as to where I should go now, I'm super confused on what I should do.
Upvotes: 0
Views: 1073
Reputation: 7556
I suggest two options:
div
, and then only show the page that is relevant (using slideTo
for slides or *ngIf
for div
). The social login can be added outside of the slides/div so it would be visible in all pages. You can put it in a footer. Upvotes: 1
Reputation: 182
Since you have the LoginPage added to your module. You can use Ionic built-in ModalController
to popup your login page everywhere you need it.
Here is an example:
export class MyPage {
constructor(public modalCtrl: ModalController) {
}
presentModal() {
let modal = this.modalCtrl.create(LoginPage);
modal.present();
}
}
Source: https://ionicframework.com/docs/components/#modals
Upvotes: 0