Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Ionic 2 modal and view stack automatically

$
0
0

@tzookb wrote:

I'm building a new app with ionic 2, it's a workout app.

one page handles the whole "workout", means it loos over the exercises and launches modal for showing the exercise and launches modal for the "rest" timer.

My problem is when I add modal with user events the app get blacked out...

example code:

 export class WorkoutRunnerPage {
     workout: Workout;
     currentRoutine: Routine;
     routineIndex = 0;

    constructor(nav: NavController, navParams: NavParams) {
        console.log('workout runner constructor');
        this.workout = navParams.get('workout');
        this.nav = nav;
        this.start();
    }

   start() {
        let routine = this.workout.routines[this.routineIndex];
        let modal = Modal.create(ExerciseModal, {routine: routine});
        this.nav.present(modal);
    }

now this is the exercise Modal

export class ExerciseModal {
       constructor(nav: NavController, params: NavParams) {
            this.nav = nav;
            this.exercise = params.get('exercise');
            this.reps = params.get('reps');
        }

       close() {
           this.nav.pop();
       }

As you can see, the user doesn't interact with the workout page... it launches it automaticly but when user closes the exercise modal it goes back to the main application page and not to the exercise page.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>