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