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

Angular binding does not work in shady dom. #1722

Closed
wheatjs opened this issue Jun 2, 2015 · 7 comments
Closed

Angular binding does not work in shady dom. #1722

wheatjs opened this issue Jun 2, 2015 · 7 comments
Assignees

Comments

@wheatjs
Copy link

wheatjs commented Jun 2, 2015

The angular curly braces delimiter does not seem to work inside of Polymer elements.

Here is some sample code.

<section ng-controller="appCtrl">
    <paper-material elevation="1" ng-repeat="video in videos">{{video.title}}</paper-material>
</section>

This should output the videos title in the paper material elemtn, but instead it outputs "{{video.title}}". I have tried changing the angular delimiters to "[[ ]]", but still get the same result. Using "ng-bind" seems to work though.

<section ng-controller="appCtrl">
    <paper-material elevation="1" ng-repeat="video in videos" ng-bind="video.title"></paper-material>
</section>

This will output the videos title.

This only seems to happen if the angular controller is declared outside of the polymer element and then the binding used inside an element. This worked before in Polymer 0.5, so I am guessing that it has something to do with shady dom.

@zishanj
Copy link

zishanj commented Jun 2, 2015

I guess you should use some other delimiter like ## ##, because both brackets delimiter are used by Polymer.

@wheatjs
Copy link
Author

wheatjs commented Jun 2, 2015

The output is the same either way. I wasn't very clear on the output when I posted this, so I will clarify real quick.

When I use curly braces, it outputs the title and the delimiter, so it looks like this:
Video Title{{video.title}}

When I change it to using ## ##, the output looks like this:
Video Title##video.title##

So it still outputs the right value, but it also appends the delimiter and variable.

@justinfagnani
Copy link
Contributor

@Wheately I suspect Shady DOM is the culprit, but I would have thought the symptom would be just a little different. So to check my assumptions, can you create a minimal reproduction I can look at? Either Bower installable, or a .zip with dependencies (dev versions) included. Thanks!

@wheatjs
Copy link
Author

wheatjs commented Jun 2, 2015

@justinfagnani I created a minimal reproduction, here is the link: https://drive.google.com/file/d/0ByZ5z4vVbzCRYkJldHUxQXQtY1E/view?usp=sharing

@ebidel ebidel added the interop label Oct 21, 2015
@tjsavage tjsavage added the 1.x label Sep 8, 2016
@TimvdLippe
Copy link
Contributor

@robdodson do you know if this has been fixed since?

@robdodson
Copy link
Contributor

I don't know about Angular 1 but Angular 2.x seems to work fine.

@TimvdLippe
Copy link
Contributor

Closing per above comment. Please let us know if you are still running into issues with interopability with Angular.

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

No branches or pull requests

8 participants