1. 41
    Adding Restaurant Information to our Popups
    30s

Adding Restaurant Information to our Popups

Colby Fayock
InstructorColby Fayock
Share this video with your friends

Social Share Links

Send Tweet
Published 4 years ago
Updated 4 years ago

Now that we have our popups, we need to actually put some information in them!

Click here for exercise instructions

Instructor: [0:00] With each location, we want to show more than just its name. First, we need to destructure the rest of that information. When using setContent, we can actually set HTML. We're gonna start by creating a new constant called HTML. We're going to set it equal to a template literal tag, which we'll use for our HTML.

[0:13] Here, we're going to set a div to wrap it and we're setting our name inside of an H3 using a template variable. Now, if we change that content to that HTML, we can see each of our new popups which contains that H3.

[0:22] We can do something similar. I'm going to add this unordered list which has the rest of our information. Now, if we click the marker, we can see the names, some info, and its contact information.

egghead
egghead
~ 20 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today