anyone knows how to load other page inside ion-segment. I;m using ionic v4 I have three pages which i am trying to display inside of ionic segments (profile, vaccination, development). I want to keep the functionality of the pages segregated for easier maintainability.
childdetails.page.html
<ion-content padding>
<ion-toolbar>
<ion-segment (ionChange)="segmentChanged($event)" [(ngModel)]="segment" color="warning">
<ion-segment-button value="profile" (ionSelect)="goToProfilePage()">
Profile
</ion-segment-button>
<ion-segment-button value="vaccination">
Vaccination
</ion-segment-button>
<ion-segment-button value="development">
Development
</ion-segment-button>
</ion-segment>
</ion-toolbar>
<div [ngSwitch]="segment">
<ion-list *ngSwitchCase="'profile'">
<<**I would like to include addchild.html here**>>
</ion-list>
</div>
</ion-content>
childdetails.page.ts
import { Component, OnInit, ViewChild } from '@angular/core';
@Component({
selector: 'app-childdetails',
templateUrl: './childdetails.page.html',
styleUrls: ['./childdetails.page.scss'],
})
export class ChilddetailsPage implements OnInit {
/**
segment = 0;
*/
segment: string = "vaccination";
constructor() {}
ngOnInit() {
}
async segmentChanged() {
this.segment}
}
I don’t want the content to be loading from inside the same page that contains the segment like below code. since each of those will be near about 150-200 lines of code. its better to keep them in separate pages.
<div [ngSwitch]="segment">
<ion-list *ngSwitchCase="'profile'">
<p> I dont want it to be like this </p>
</ion-list>
</div>
Anyone know how to do this ? Thank you in advance