aurelia / templating

An extensible HTML templating engine supporting databinding, custom elements, attached behaviors and more.
MIT License
116 stars 104 forks source link

Get parent element from binding behaviour in custom attribute #439

Closed jods4 closed 8 years ago

jods4 commented 8 years ago

Issue: it is impossible to get at the parent element from a binding behavior, if the behavior is used inside a custom attribute.

Context: I have built a validation component. It makes use of a binding behavior, which wants to grab the element, in a fashion that is exactly the same as this one from aurelia-validation: https://github.com/aurelia/validation/blob/master/src/validate-binding-behavior.js#L18-L31

The code is slightly complicated, but let's say that's an advanced use. At least it seems possible!

But in practice there are three cases to cover:

I have no opinion how this could/should be fixed. Maybe an addition to binding or is that too costly? Otherwise an addition to the attribute controller?

jdanyow commented 8 years ago

https://github.com/aurelia/validatejs/issues/97

jdanyow commented 8 years ago

closing- will be covered in #457