我想使用navCtrl.push将后退按钮从 exercisesPage 推送到 exerciseFlashCardPage 。由于某种原因,页面重定向到page2并具有后退按钮,但是该按钮不起作用甚至无法单击。
export class ExerciseFlashcardPage {
currentQuestion = 0;
exercise: Exercise[] = [];
questions: Observable<any>;
type: string;
answer = {} as Answer;
mssg = {} as AnswerMssg;
isValid = false;
constructor(public navCtrl: NavController, public navParams: NavParams, public afd: AngularFireDatabase,private cdRef:ChangeDetectorRef) {
this.type = this.navParams.get('data');
this.questions = this.afd.list('exercises/' + this.type).valueChanges();
}
ionViewDidLoad() {
console.log('ionViewDidLoad ExerciseFlashcardPage');
}
next(){
this.isValid= false;
++this.currentQuestion;
}
check(ans : any){
this.isValid = true;
if(this.answer.answered ==ans){
this.mssg.status = "Correct"
this.mssg.answer = ans;
this.mssg.icon = "checkmark-circle-outline";
}
else{
this.mssg.status = "Wrong"
this.mssg.answer = ans ;
this.mssg.icon = "close-circle-outline";
}
}
}
export class ExercisesPage {
constructor(public navCtrl: NavController, public navParams: NavParams) {}
public navigateTo(text:string){
this.navCtrl.push("ExerciseFlashcardPage", {
data:text,
});
}
}
答案 0 :(得分:0)
请检查控制台并在此处共享该信息。
通常,当某些操作不起作用时,是因为存在一些控制台错误。