question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to display Names and Emails in different lists?

<!DOCTYPE html>
<html lang="en">

<head>
  <title>Loops</title>
</head>

<body>

  <main id="app"></main>

  <script src="https://cdn.jsdelivr.net/npm/lemonadejs/dist/lemonade.min.js"></script>

  <script>
    function App() {

      let self = {

        members: [{
            name: "Albert",
            email: "alberto@email.com",
            age: 38
          },
          {
            name: "Alberto",
            email: "albert@email.com",
            age: 26
          },
          {
            name: "Sylvain",
            email: "sylvain@email.com",
            age: 57
          }
        ]

      };

      let template = `<>
          <h2>Loops</h2>

          <div>
            <h5>Names</h5>
            <ul @loop="self.members">
              <li> {{self.name}} </li>
            </ul>
          </div>

          <hr />

          <div>
            <h5>Emails</h5>
            <ul @loop="self.members">
              <li> {{self.email}} </li>
            </ul>
          </div>

        </>`;

      return lemonade.element(template, self);
    }


    lemonade.render(App, document.querySelector('#app'));
  </script>

</body>

</html>

Expected: image

But: image

How to get the expected result?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
hodewarecommented, Apr 16, 2022

We are creating a alternative for that… it should be released soon

2reactions
sucomcommented, Apr 16, 2022

Yeah. but, why do we really need to build different arrays as we can’t create and call multiple APIs for this approach or after getting from one API then creating multiple arrays for a large set, it doesn’t seem to be right or scalable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

United States - Loop
Walmart launches Loop reusable packaging range online, delivered straight to your home with W+ InHome. Learn More. available instore.
Read more >
Loop Earplugs: Your life, your volume
Choose how you hear the world with Loop. Backed by years of continuous R&D, our certified hearing protection is the perfect balance between...
Read more >
Loop Returns: Ecommerce Returns Management for Shopify ...
Loop helps Shopify's best brands optimize return costs, retain more revenue, and prevent return losses.
Read more >
Loop Definition & Meaning - Merriam-Webster
verb ; 1. a. : to make a loop in, on, or about. b. : to fasten with a loop ; 2. :...
Read more >
Loop TV: Free TV & Digital Signage for Businesses
Loop is a free music video, business TV and digital signage service, fully licensed to run in businesses. Grab your free Loop TV...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found