aurelia / templating-binding

An implementation of the templating engine's Binding Language abstraction which uses a pluggable command syntax.
MIT License
32 stars 26 forks source link

"for" attribute with string interpolation gets removed from <ul> element #64

Closed DarienFord closed 8 years ago

DarienFord commented 9 years ago

I have a component which I reuse in different parts of the app. In some cases, it is instantiated by different parent components.

I'm using the mdl lite framework from google and it uses the for attribute on a UL to determine how and when to display a drop down menu.

To facilitate this, I need to generate unique IDs for each instance of my component. I have the view model generating an ID appropriately, but as soon as I put a variable into the for attribute, the attribute does not get rendered on the DOM.

<ul for="a">
    <!--- for is rendered -->
    </ul>
    <ul for="a${instance}">
    <!-- for is not rendered -->
    </ul>
jdanyow commented 9 years ago

Will fix this as part of https://github.com/aurelia/templating-binding/issues/32

What's happening is 'for' maps to the htmlFor dom api which makes sense for a label el but not for a ul.

DarienFord commented 9 years ago

Thanks!

jdanyow commented 8 years ago

fixed in https://github.com/aurelia/templating-binding/commit/4f3e91198a0102ca82fc791d5b69a77cfff94e43