Meteor: need to generate unique branch labels for file includes within loop structures #157

Closed
bminer opened this Issue Mar 21, 2013 · 4 comments

Comments

Projects
None yet
2 participants
Owner

bminer commented Mar 21, 2013

Right now, the only way to ensure that Blade is properly generating branch labels is when using the foreach loop structure. That is, file includes within a foreach loop work just fine.

Regular for loops, while loops, etc. do not work as desired.

+1

same for _.map() -- at least from within Template helpers

Owner

bminer commented Jul 24, 2013

What about just adding a branchLabel keyword to Blade?

Usage:

- for(var i = 0; i < arr.length; i++)
    branchLabel arr[i].id
        p Item #{arr[i].id}: #{JSON.stringify(arr[i])}

The trick here is that every element in the array must have a unique identifier.

Or, for file includes (the main purpose of this issue):

- for(var i = 0; i < arr.length; i++)
    branchLabel arr[i].id
        - var item = arr[i]
        include "child_template" exposing item

I wonder if this would work, too....

- for(var i = 0; i < arr.length; i++)
    branchLabel i
        - var item = arr[i]
        include "child_template" exposing item

Hmm... interesting...

Owner

bminer commented Aug 7, 2013

Hey everyone who is interested. I haven't forgotten about this issue. It's just that Meteor & Spark have been changing quite a bit lately, and I think that I would rather wait for everything to become a bit more finalized before investing much more time in it. Thanks for you patience!

Owner

bminer commented Nov 16, 2017

Closing this issue. Dropping Blade + Meteor support for now. :(

@bminer bminer closed this Nov 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment