Ich erhalte diesen Fehler:Property X existiert nicht auf Typ Y []
questions does not exist on type 'Quiz[]'
Das ist mein Modell
export interface Quiz {
$key ?: string;
categorie ?: string;
questions : Questions[]
}
export interface Questions {
id ?: number;
question ?: string;
answer?: string;
}
Und dies ist mein Code
import {Quiz} from "../models/quiz";
export class ProfComponent {
quiz = [] as Quiz[];
nextQuestion(quiz) {
this.quiz.questions.push(quiz.questions)
}
}
Ich kann keine Daten in quiz.questions
was könnte falsch sein?
async nextQuestion (Quiz) { erwarten this.quiz.push (Quiz) } – Afnor