LoginSignup
3
3

More than 5 years have passed since last update.

Ionic4 でのルート処理の変更点

Posted at

はじめに

この記事では、以下の記事で、NavController.goRoot('ルート先')
関数が使えなくなっていた。

Ionic 4とFirebaseでチャットアプリ

調べてみたら、以下のホームページで変更点があったということが分かったので、
そのことについて記述していきたいと思います。

変更点


import {NavController} from '@ionic/angular';
export class RoomPage implements OnInit {
    construtor(public navCtrl:NavController){}
         :
    ngOnInit() {
         :   
       // goBack() → navigateBack() に変更
       this.navCtrl.navigateBack('ルート先')
    }
}

このように、ionic4では、navControllerで、ルート処理に関する変更があった。

  • goForward() → navigateForward()
  • goBack() → navigateBack()
  • goRoot() → navigateRoot()

以上の点を踏まえて、進めていく方がいいです。

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3