Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Express Basics Parameters, Query Strings, and Modularizing Routes Randomize Cards

Question link not showing up

Does anyone see anything wrong with this code? My answer link is working, but I can't get the question link to appear once the answer is being displayed.

  if (side === 'question') {
    templateData.hint = hint;
    templateData.sideToShow = 'answer';
    templateData.sideToShowDisplay = 'Answer';
  } else if (side === 'answer') {
    templateData.sideToShow = 'question';
    templateData.sideToShowDisplay = 'Question';
a(href=`${id}?side=${sideToShow}`)= sideToShowDisplay

I had this issue. The solution was just to take my anchor link out of the hint if loop by indenting the anchor element once to the left.

1 Answer

I modified my interpolation in card.pug like below and it works for me.

a(href= id + '?side=' + sideToShow ) #{sideToShowDisplay}