1
我在导航到产品页时出现错误,我正在使用NavParams
。这里是我的代码:错误:没有NavParams的提供商
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);
}
}
在此先感谢您。
不,它不起作用! –
对于直接与文档相矛盾的内容,这非常有用 – Kai