-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[1.0] Data-binding: Is there any way to do this imperatively? #1778
Comments
AFAIK, My apologies, I might not have been clear earlier. Declarative approach: ...
<link rel="import" href="my-foo.html">
...
<dom-module>
<template>
<!-- Look, I loaded <my-foo> and did a two-way bind declaratively -->
<my-foo foo="{{bar}}"></my-foo>
</template>
<script>
Polymer({
is: "my-element",
properties: { bar: String },
...
});
</script>
</template> Imperatively, how do I do the above? |
Were you able to do
and have it correctly execute the binding? That seems rather strange. Edit: Now that I think of it, it might have worked because they showed you the |
Nope, doesn't work, check out the jsbin: (http://jsbin.com/hiloloqoju/1/edit) This used to work with 0.5 though. |
No, we don't currently support this, outside of Note that We are achieving a lot of performance optimization by baking the binding connections into the prototype at registration time for an element (rather than at instance time), and we haven't built up enough of the machinery to easily allow runtime addition/removal of bindings. |
Thanks for the detailed explanation. I suppose I could kind of emulate the data-binding behaviour by:
|
So, if this is no longer available in Polymer, why should I use Polymer with my APP? |
Is this still up to date? Or rather, is there no easy way to dynamically import and create a custom element with data-binding properties? |
Any updates or plans for updates on this? or any workarounds? |
I have same issue and search too much but finally use write this code to solve my problem.
|
same here ,and how can i get the data
|
@AliMD not event match the problem,I need functions like dom to create doms dymamiclly depending on parsing the json data |
use a template :) , but issue is for each parent location of dyanamic component we need separate "myElements" and template definition
|
Hello, considering the below snippet,
Full jsbin: (http://jsbin.com/hiloloqoju/1/edit)
In 0.5, I could simply imperatively import a Polymer element, then insert its markup into the DOM. Could I do something like that in 1.0?
Thanks so much,
J
The text was updated successfully, but these errors were encountered: