antonmedv / monkberry

Monkberry is a JavaScript library for building web user interfaces
https://monkberry.js.org
MIT License
1.49k stars 78 forks source link

No Access to Outer Scope, within if inside for loop? #32

Closed Nexxtron closed 7 years ago

Nexxtron commented 7 years ago

Hey, at first, I want to say thank you, for this brilliant Library.

Now to the actual Problem. I am currently writing a complex UserInterface where I need multiple conditions and "for"-loops inside each other. But I can´t access the outer Scope variables inside a "if"-condition within a "for"-loop...

Documentation says: "To access outer scope specify iterator name." -> {% for user of array %} {{ user.name }} {% endfor %}

Here is the Fiddle to demonstrate where I can´t have access to the Outer Scope Property "outer": https://jsfiddle.net/cjb207sr/4/

-> And when I update the View a second Time the Outer Scope works: https://jsfiddle.net/cjb207sr/5/

Is this intended? Or a bug?

antonmedv commented 7 years ago

Hi, this looks like bug for me.

I will take a look as soon as possible.

antonmedv commented 7 years ago

Fixed in 4.0.8.

Nexxtron commented 7 years ago

Thank you, very much!