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.

Problem using m-for in a template

See original GitHub issue

Moon is emitting this error in the console:

moon.js:179 [Moon] ERROR: The item "arr" was not defined but was referenced

I am trying to render loops in a template, here is a quick example below:

  Moon.component('my-component', {
            template: `<div>
                <p>This is a Component!</p>
                <select>                   
                    <option m-for="item in arr" value="{{item}}">{{item}}</option>
                </select>
                <span>End</span>                
            </div>`
        });

        const app1 = new Moon({
            el: "#app1",
            data: {
                msg: "Hello Moon!",
                arr: [4, 5, 6]
            }
        });

Anyone know what I am doing wrong? Thanks

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kokujincommented, Feb 21, 2018

Thanks

0reactions
sadeghbaraticommented, Jun 13, 2018

@kbrsh can u update @kokujin jsfiddle ???

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pitch Deck Problem Slide | How-to Instructions
Create the perfect Problem Slide for your pitch deck and impress investors ✓ Content ideas ✓ Best practices ✓ Design proposals ✓ ➤...
Read more >
What's Wrong with C++ Templates?
Templates are a natural match for lists (and container classes in general) because they not only let programmers write one List implementation rather...
Read more >
Getting around issues with templates inside Dll in C++?
I currently have a game engine project structured in visual studio so that my 'Engine' is compiled into a dll for another project...
Read more >
Problem with Templates during compilation
Hi guys, I have a problem during the compilation of my solver in OpenFOAM-7. I'll explain a bit my work. I'm translating a...
Read more >
Tech Tip - Fix Default Template Issues - YouTube
CADimensions is an authorized SOLIDWORKS reseller for New York and Pennsylvania. If you would like to learn more about the products and ......
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