this.app.getRootNav().push(); promblem

Hello, i have question about this.app.getRootNav().push();

rule(idx) {
if(idx == 0) {
this.app.getRootNav().push(RulesPage, {“type”:“rules1”});
} else if(idx == 1) {
this.app.getRootNav().push(RulesPage, {“type”:“rules2”});
console.log("page id is: " + this.app.getActiveNav().id);
}
}

this is my *.ts code and when i click the rule(idx == 1)
RulesPage type is not change at all.

These are my RulesPage .

<ng-template [ngIf]=“type == ‘rules1’”> blahblahblah A
<ng-template [ngIf]=“type == ‘rules2’”> blahblahblah A

export class RulesPage {
public type = ‘rules1’;
public header_data:any;
constructor(public navCtrl: NavController, public params: NavParams, public menu:MenuController) {
this.header_data={isBasket:false};
}
ionViewDidEnter() {
// the root left menu should be disabled on the tutorial page
this.menu.enable(false);
}
}

i click the rule(2) and check the console.
It shows “(getRootNav) is deprecated and will be removed in the next major release. Use getRootNavById instead.”

How can i work “rule(2)” and RulesPage type is changed ?

Thanks.