AngularJS Quiz App Tutorial (16/24) - Basic Error Handling with Bootstrap Alerts

preview_player
Показать описание
The writeup for this video:

Part 1 of this series:

The Git Repo for this project:

Error handling is something that all developers should be considering at all points of the development of applications.

In this series we arent diving really deep into error handling but we will take a quick look at using bootstrap alert elements to give the user a warning when they are trying to end the quiz but still have some unanswered questions.

Once we have that done we will start finalising the quiz and creating some final checks to ensure that all questions have been answered before we start moving toward the results page.

Support Me On Patreon

One Off Donations:

Bitcoin: 39iDX27ZSkYtRhUrH5r5YN128wEjwDmSYp
Ethereum: 0x38b3cBF8Ee3EeeeA33D1925bA0ce0e90c8EcFD46
Horizen (ZEN): znanBCHpWJecBwZZmft9r5QzbzRX4nQn6Dz

Check Out The Site!

SUBSCRIBE!

Join the Community!

Рекомендации по теме
Комментарии
Автор

Awesome tutorials! Thanks a ton Adrian! You teach developers across the world who want to study angularjs. Well done!
By the way, in the 16th episode of your series, taking account into one user is likely to finish question through toolbar instead of "continue" button, the variable numQuestionsAnswered inside function questionAnswered() will get wrong value. It seems better to put numQuestionsAnswered into function selectAnswer(). Herein are my codes: names may be a little different but you could understand them in literal.
function selectAnswer(index){
//ensure number only increment once if user changes answer
=== null){
numberOfAnsweredQuestions++;
}
= index;
}
function questionAnswered(){
var numberOfQuestions = temp.quizData.length;
if(numberOfAnsweredQuestions === numberOfQuestions){
temp.error = false;
temp.finalize = true;
return;
}

temp.setActiveQuestion();
}

donaldt
Автор

The best Angular 1 tutorial I've seen :) Great job and Im looking forward for next one :)

Ewdep
Автор

Thanks a zillion, my friend. This is great help.

webdevstudio
Автор

Thanks for this course Adrian, really well put together. Will probably need to watch a few times for everything to sink in properly. Any advice on sticking on one framework. Ie now its up to Angular 4 plus theres Vue, React, Meteor etc etc.

lardosian
Автор

Hello, I have a question. the line of code:numQuestionAnswered >= quizLength, this means all the questions were answered, so I think the for loop is not necessary. Is that correct?

thank you

王梦遥-lh
Автор

I'v got infinite loop here, when all the questions have been answered and i click continue:( and in your code too.

anatoliystukota