Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

209
Views
¿Botón incremental para una secuencia de preguntas en AngularJS?

Hola a todos, construí una secuencia simple de preguntas en AngularJS. Cada vez que presiono y respondo, paso a la siguiente pregunta.

 <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>

la función de cambio es la siguiente

 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);

¿Alguien sabe cómo puedo crear un botón en el que se debe hacer clic para pasar a la siguiente pregunta en lugar de pasar automáticamente cada vez que elijo una opción?

Estoy tratando de crear un módulo simple y conectarlo a un botón html pero no funciona

 pass_Next(){ this.currentQuizz++; }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Esto funcionó. Estaba escribiendo incorrectamente el "pass_Next"

 pass_Next(){ this.currentQuizz++; }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!