Cannot get rootParams in ionic v2 tab page


up vote
down vote
in ion-tabs

<ion-tab [root]="tab1Root" [rootParams]="{'id': '23'}"  tabIcon="chatbubbles"></ion-tab>

and in tab1Root Page js

    import {Page, NavController, Events, Config, Storage, LocalStorage, NavParams} from 'ionic/ionic';
    constructor(nav: NavController,config: Config, params: NavParams) {
        this.nav = nav;
        this.params = params; = params.get('id');

and error in console

TypeError: Cannot read property 'id' of null


You should access directly like this
private navParams : NavParams
) {;



I used service like navParams. But I will try this method. Thank You !