Skip to content
This repository was archived by the owner on Oct 5, 2019. It is now read-only.
This repository was archived by the owner on Oct 5, 2019. It is now read-only.

Move Chapter Menu to Sidemenu #48

@ibby89

Description

@ibby89

Hi Jan,

I've been trying and trying with this but cannot get the chapter menu into the sidemenu unfortunately.

I am aware that the TOC page maps the epub chapter data using navParams, and this cannot be done on app.ts as the sidemenu data is mapped using ViewChild(Nav).

If I set the app.html up to list the chapters exactly as the TOC page does, could you let me know what I am doing wrong? It currently looks like this:

<ion-menu [content]="content">
    <ion-header>
      <ion-toolbar>
        <ion-title>Menu</ion-title>
      </ion-toolbar>
    </ion-header>
  
    <ion-content>
      <ion-list>
        <ion-item class="toc" *ngFor="let chapter of toc" (click)="selectToc(chapter)">
          {{chapter.label}}
        </ion-item>
      </ion-list>
    </ion-content>
  
  </ion-menu>
  
  <!-- Disable swipe-to-go-back because it's poor UX to combine STGB with side menus -->
  <ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>

App.ts:

import { Component, ViewChild } from '@angular/core';
import { Nav, Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';

import { HomePage } from '../pages/home/home';
import { TocPage } from '../pages/toc/toc';
import { BookPage } from '../pages/book/book';



@Component({
  templateUrl: 'app.html'
})
export class MyApp {
  @ViewChild(Nav) nav: Nav;
  rootPage:any = BookPage;

  constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
    platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      statusBar.styleDefault();
      splashScreen.hide();
    });
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions