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

Reference child view model with ref-vm #113

Closed ZoolWay closed 7 years ago

ZoolWay commented 7 years ago

I'm submitting a feature request

Current behavior: We can use the attribute ref to get a reference to an element in the view model easily.

This this element is an aurelia component, I can use myElement.au.controller.viewModel to get the corresponding view model instance.

Expected/desired behavior: Getting child view models would be much easier if we introduce an attribute ref-vm which does the same but resolves the view model or assigns undefined if the element does not have one.

StrahilKazlachev commented 7 years ago

Do I understand correctly that you want view-model.ref?

ZoolWay commented 7 years ago

Oh yes, didn't find out about those 😞 Thanks!