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

Why does Ionic 4 provide NavParams either it does not work?

$
0
0

@Dovel wrote:

import { Component } from '@angular/core';
import { NavParams } from '@ionic/angular';

@Component({...})
export class MyPage {
  constructor(
    navParams: NavParams
  ) {
    console.log(navParams.get('foo'));
  }
}

Result: No provider for NavParams!

My current solution is to use router.getCurrentNavigation().extras.state and pass the data by extras state. But maybe there is a better solution? I want to pass data as body. Not as query params in the url.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70796

Trending Articles



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