Closed vidhill closed 6 years ago
It already should be supported, resolved data are getting passed to ui-view. https://github.com/ergo/polymer-ui-router/blob/master/uirouter-uiview.html#L140
Which method should work? Using the binding syntax above?
I can get the resolver to pass data alright, but I can't work out hot to pass a value from a parent scope -As I cannot seem to get a reference to the element from the Resolver
@vidhill I think you might be right here, I never used this functionality in either angular or polymer.
This would require probably some changes in uirouter-uiview
, is there any other way to pass the binding downwards in the meantime?
I don't know, I'm kind of scratching my head.. I could introduce polymer-redux to my project, but I don't want to do too much refactoring in one PR
I might try giving modifying uirouter-uiview a go,
from what I read Polymer doesn't provide any utilities for adding bindings to manually created elements
@vidhill pinged you on slack
Closing, feel free to reopen if you need help.
@vidhill I'm repoening this, currently looking for a solution which allows discovering and observing properties unknown upfront.
https://github.com/Polymer/polymer/issues/4636 - this issue should be helpful.
Next release of ui-router will allow for something like this:
<uirouter-uiview component="default-comp" counter="[[counter]]" clock="[[clock]]"
pass-downwards="[[passDownwards]]"></uirouter-uiview>
where passDownwads
is an array of ['counter', 'clock']
and this will hint the view to pass the props to stomped element and create change observers to get things in sync.
I have some data that I was passing down to child elements using binding,
I don't think I can do that with
uirouter-uiview
, I thought I might be able to do it using a resolve function but the context forthis
is the global element..I've read the source and I don't know if this is possible,