Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webc for loop #186

Open
LegendT opened this issue Jun 29, 2023 · 2 comments
Open

webc for loop #186

LegendT opened this issue Jun 29, 2023 · 2 comments

Comments

@LegendT
Copy link

LegendT commented Jun 29, 2023

This may be the same issue as #179

band.md

---
layout: band_profile.webc
bandName: The Band
bandBio: The Band Bio
bandVideos:
  - videoID: shEPwQPQG4I
    videoName: Snotty
  - videoID: ykn4XNDwW7Q
    videoName: Kev Dev
---

band_profile.webc

<div webc:if="bandVideos">
    <h2>Band Videos</h2>
    <p @text="bandVideos[0].videoID"></p> // this works
    <youtube-embed
        webc:for="bandVideo in bandVideos"
        :@videoid="bandVideo.videoID" // This does not work
    ></youtube-embed>
</div>

Issue Description:

The bandVideos array is not being rendered correctly in the band_profile.webc file. The youtube-embed element is not being rendered correctly. The expected behaviour is for the bandVideos array to be rendered with each youtube-embed element displaying the videoID of the corresponding object in the array.

Expected Results:

The bandVideos array should be rendered correctly with each youtube-embed element displaying the videoID of the corresponding object in the array.

Actual Results:

The bandVideos array 'videoID' is not being rendered in the band_profile.webc file.

@Zearin
Copy link
Contributor

Zearin commented Aug 2, 2023

@zachleat Excellent report, this

@zeroedin
Copy link

Use of instead of in

    <youtube-embed
        webc:for="bandVideo of bandVideos"
        :@videoid="bandVideo.videoID" 
    ></youtube-embed>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants