Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

210
Visualizações
Incrementing button for a sequecne of question in AngularJS?

Hi everyone I build a simple sequence of questions in AngularJS. Every time I press on and answer I pass to the next question.

  <div class="answers" >
    <ul class="answers__list" *ngFor="let quiz of quizzes[currentQuiz].answer" >
        <label><li @answer class="answers__item" appBackground [correctAnswer]="quiz.correct">
            <input  type="radio" name="options" (change)="onAnswer(quiz.correct)" [disabled]="answerSelected">  <!-- Here you select when change the question ("onAnswer means that u change it when you give a questioN"-->
            {{ quiz.option }} <!--Needed to render out the question -->
        </li></label>
      </ul>
  </div>

the change function is the following

  onAnswer(option: boolean){
      this.currentQuiz++;

      this.answerSelected = true;
      setTimeout(() => {
        let newQuiz = this.getRandom();
         while(this.prevAnswered.includes(newQuiz) && this.prevAnswered.length < 2){
          newQuiz = this.getRandom();
         }
         this.currentQuiz = newQuiz;
         this.prevAnswered.push(this.currentQuiz);
         this.answerSelected = false;
      }, 300);

Does someone know how I can create a button that has to be clicked in order to pass to the following question instead of passing automatically everytime I choose an option?

I am trying to create a simple module and connecting it to an html button but is not working

pass_Next(){
 this.currentQuizz++;

}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

This worked I was writing incorrectly the "pass_Next"

pass_Next(){
 this.currentQuizz++;

}
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda