Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Way to refer to parent model via expression #152

Open
asudoh opened this issue Sep 4, 2014 · 3 comments
Open

Way to refer to parent model via expression #152

asudoh opened this issue Sep 4, 2014 · 3 comments

Comments

@asudoh
Copy link
Contributor

asudoh commented Sep 4, 2014

To do so currently requires application or third-party system to implement “binding source factory” API, which let you parse {{expression}} yourself and determine what to do with the expression (you can see some implementations in liaison/alternateBindingSource.js). May be worthwhile to consider doing that right in liaison. It may involve supporting “named scope” ({{name in model}}).

@cjolif
Copy link
Contributor

cjolif commented Sep 5, 2014

I would tend to say this would be nice addition, writing your own expression parsing is definitely not something everyone would like to deal with.

interested in @tkrugg & @damiengarbarino feedback

@damiengarbarino
Copy link

Not sure to completely understand the topic as I never used liaison so ignore this remark if I am out of the scope of this issue.
Angular ng-repeat directive is working like that ("item in list") and creates a child scope. It allows to use other list properties or other properties of the scope inside the loop.
My 2 cents

@asudoh
Copy link
Contributor Author

asudoh commented Sep 12, 2014

As far as I see how Angular works on repeat, it appears to put parent scope to scope’s prototype. So scope has read-only access to parent scope’s properties. liaison (as well as Polymer) do not have “scope” notion and they work in a way of putting model to <template>. It would be intrusive to overwrite prototype of such model for the sake of access to parent <template>’s model properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants