亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

錯誤:無法解析 LoginPage 的所有參數:

錯誤:無法解析 LoginPage 的所有參數:

紅顏莎娜 2022-08-18 16:13:16
我面臨下一個錯誤,無法理解如何解決它。錯誤:無法解析 LoginPage 的所有參數:([對象對象]、[對象對象]、[對象對象]、?)。我已經檢查了這里的幾乎每個主題,并嘗試了多種方法來解決它,但仍然無法在第二天擊敗它。Login.tsimport { Component } from '@angular/core';import { IonicPage, NavController, NavParams,AlertController } from 'ionic-angular';   import { AuthProvider } from '../../providers/auth/auth';import { TabsPage } from '../tabs/tabs';/*** Generated class for the LoginPage page.** See https://ionicframework.com/docs/components/#navigation for more info on* Ionic pages and navigation.*/@IonicPage()@Component({selector: 'page-login',templateUrl: 'login.html',})export class LoginPage {email:string = '';password:string = '';errorMsg:string;constructor(public navParams: NavParams,public navCtrl: NavController,public alertCtrl: AlertControllerpublic authService: AuthProvider,) {}ionViewDidLoad() {console.log('ionViewDidLoad LoginPage');}errorFunc(message){let alert = this.alertCtrl.create({  title: 'oops!',  subTitle: message,  buttons: ['OK']});alert.present();} myLogIn(){if (this.email.trim() !==''    ) {  console.log(this.email.trim() + "   " + this.password.trim() )  if (this.password.trim()  === '') {    this.errorFunc('Please put your password')  }  else{    let credentials = {      email: this.email,        password: this.password    };     this.authService.login(credentials).then((result) => {        console.log(result);        this.navCtrl.setRoot(TabsPage);    }, (err) => {        console.log(err);        this. errorFunc('Wrong credentials ! try again')        console.log("credentials: "+JSON.stringify(credentials))    });  }  }  else{  this. errorFunc('Please put a vaild password !  for ex:(123456)')  }  }  myLogOut(){  this.authService.logout();  }  }Auth.tsimport { Injectable } from '@angular/core';import { Storage } from '@ionic/storage'; import { Http , Headers } from '@angular/http';import { TabsPage } from '../../pages/tabs/tabs';
查看完整描述

1 回答

?
拉莫斯之舞

TA貢獻1820條經驗 獲得超10個贊

你似乎有一個經典的循環引用。您在兩個和“”中都導入了“TabsPage”。Auth.tsLoginPage.ts

經典的循環引用。

嘗試從 Auth.ts 中刪除 TabsPage。通常,最好讓組件執行非常具體的事情,以便獲得粒度代碼并避免此類循環引用問題。


查看完整回答
反對 回復 2022-08-18
  • 1 回答
  • 0 關注
  • 130 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號