-4

I want to include HTML page as a content for ion-content. I need to have multiple views of the single page.

home.ts:

goto(item){
    console.log(item);
  }

home.html:

<ion-list>
    <ion-item (click)="goto('android')">Android</ion-item>
    <ion-item (click)="goto('java')">Java</ion-item>
    <ion-item (click)="goto('ionic')">Ionic</ion-item>
</ion-list>

Here, I am having different .html files for each item like android.html, ionic.html. Once selecting the item I need to show the HTML content inside the ion-view.

Sampath
  • 63,341
  • 64
  • 307
  • 441
Velmurugan
  • 11
  • 6

1 Answers1

0

Since you have all the pages then you just need to do this: You can use navCtrl.push() as shown below.

home.ts

goto(item:string){

    switch(item) {
    case "android":
        this.navCtrl.push(AndroidPage);
        break;
    case "java":
         this.navCtrl.push(JavaPage);
        break;
    case "ionic":
         this.navCtrl.push(IonicPage);
        break;
    default:
    }
 }

You can learn basics of Ionic here.

Sampath
  • 63,341
  • 64
  • 307
  • 441
  • Thanks, @Sampath. Here Android, Java are the home page items. Once selected the item (Android or Java) . need to go to detailsPage this.navCtrl.push(DetailsPage); Inside the details page I need to display the content from my .html files(Android.html or Java.html) as part of the details.html – Velmurugan Aug 17 '17 at 10:46
  • can you show the one of your `Android.html` file's code? – Sampath Aug 17 '17 at 12:26