rootParams in ion-nav not working


#1

Hi I tried to pass data in ion-nav using rootParams.

Example:
<ion-nav [root]="rootPage" [rootParams]="paramData"></ion-nav>

this.paramData = {data: ‘Testing’};

Getting Data:
navParams.get(‘data’); --> returns nothing.

How can I make it work?Thanks.


#2

from

    import { MyTabs } from './../mytabs/mytabs';
    import { Component } from '@angular/core';
    import { NavController } from 'ionic-angular';


@Component({
    selector: '[focuser]',
    templateUrl: 'login.html'
})
export class Login {
    myForm: FormGroup;
    user: string;
    pass: string;

constructor(public navCtrl: NavController    {    }

doLogin(formData) {
  this.navCtrl.push(Notificaciones, { data: formData });
}

}

class that receive data
imports:

import { NavParams} from 'ionic-angular';

construnctor

 constructor(
    public navCtrl: NavController,
    public navParams: NavParams)
{
 let data= this.navParams.get("data");
}

#4

This is still an issue but a workaround is available.