Error: No provider for NavParams

Viewed 6308

I am getting an error when I navigate to product page which I am using a NavParams. Here is my code:

import { Component } from '@angular/core';
import { NavController, NavParams, AlertController, ModalController } from 'ionic-angular';

@Component({
  selector: 'page-product',
  templateUrl: 'product.html'
})
export class ProductPage {
  data: any;    
  constructor( public navParams: NavParams ) {
    this.tabBarElement = document.querySelector('.tabbar.show-tabbar');
    this.data = this.navParams.get('item');
    console.log(this.data);
  }
}

Thanks you in advance.

1 Answers
Related