Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

registerElement should support callbacks coming from deep prototype chains #52

Closed
rkirov opened this issue Mar 1, 2015 · 10 comments
Closed

Comments

@rkirov
Copy link
Contributor

rkirov commented Mar 1, 2015

The following line:

zone.js/zone.js

Line 663 in 26a4dc2

var descriptor = Object.getOwnPropertyDescriptor(opts.prototype, callback);

Checks if (opts.prototype[callback]) and then uses Object.getOwnPropertyDescriptor(opts.prototype, callback) to retrieve it. If the callback comes from the prototype chain we cannot use getOwnPropertyDescriptor.

@btford
Copy link
Contributor

btford commented Mar 2, 2015

+1

On Sun, Mar 1, 2015 at 3:30 PM Rado Kirov notifications@github.com wrote:

The following line:

zone.js/zone.js

Line 663 in 26a4dc2

var descriptor = Object.getOwnPropertyDescriptor(opts.prototype, callback);

Checks if (opts.prototype[callback]) and then uses Object.getOwnPropertyDescriptor(opts.prototype,
callback);. If the callback comes from the prototype chain we cannot use
getOwnPropertyDescriptor.


Reply to this email directly or view it on GitHub
#52.

@tkhemani
Copy link

Hi,
I tried to run the "youtube-app" demo, but it's failing at this line. I see that you've mentioned this:

need to be patched

Can you please share the patch...

@kingcody
Copy link

kingcody commented Apr 5, 2015

I encountered this issue as well (when dealing with polymer elements, see here).

@tkhemani, its not very elegant or heavily tested but here was my solution.

@tkhemani
Copy link

tkhemani commented Apr 5, 2015

@kingcody . Thanks, I got the youtube-app working after @rkirov shared the patches. But i'm still not able to get a simple polymer button working inside an angular 2.0 component directive. Can you possibly try it out.

@kingcody
Copy link

kingcody commented Apr 5, 2015

@tkhemani Working in FF, but not in Chrome.

@tkhemani
Copy link

tkhemani commented Apr 5, 2015

@kingcody, are you saying u were able to get a polymer button working inside an angular 2.0 component directive? Can you share the code.

@JoshAntBrown
Copy link

I'm having this issue too, again like @kingcody when dealing with polymer elements but this time the Google Web Component ones.

I did see a pull request at #31 which looks like it might have tried to fix the problem but implementing their code into my project stopped the console error but still didn't render the component. I also tried the solution posted in here before but same result as the pull request.

They do work in FF but not Chrome for some reason though.

@jianliao
Copy link

@JoshAntBrown Yes, there is no such issue in FF, but it seems to me the property binding like this

[hidden]="!active" 

does not work. The reason that customer element does not work in Chrome is probably due to angular/angular#1442

@justinfagnani
Copy link

Yes, you need a fix for both the zone.js and Angular issues before custom elements work. I have all this working locally, but don't have time to put together a tested PR.

@vicb
Copy link
Contributor

vicb commented May 13, 2015

@justinfagnani you can send me "some" code and I'll try to clean and PR if you like

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

No branches or pull requests

8 participants