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

Can't extend paper_elements/core_elements #20388

Closed
DartBot opened this issue Aug 6, 2014 · 8 comments
Closed

Can't extend paper_elements/core_elements #20388

DartBot opened this issue Aug 6, 2014 · 8 comments
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. closed-as-intended Closed as the reported issue is expected behavior

Comments

@DartBot
Copy link

DartBot commented Aug 6, 2014

This issue was originally filed by @terrasea


What steps will reproduce the problem?

  1. Use the following
    <link rel="import" href="../../packages/polymer/polymer.html">

<link rel="import" href="../../packages/paper_elements/paper_item.html">

<polymer-element name="x-item" extends="paper-item">
   <template>
     <shadow></shadow>
   <template>
   <script type="application/dart" src="x_item.dart"></script>
</polymer-element>

@CustomTag('x-item')
class XItem extends PaperItem {
   XItem.created() : super.created();
}
2. add the element to an html page
<link rel="import" href="x-item.html">
...
<x-item label="item"></x-item>
 ...
3. run it in Dartium

What is the expected output? What do you see instead?
I should see exactly the same output as you'd expect form paper-item, what I get is nothing, and in fact all other polymer elements don't load either.

What version of the product are you using?

Dart Editor version 1.6.0.dev_06_00 (DEV)
Dart SDK version 1.6.0-dev.6.0

On what operating system?
Gentoo Linux
What browser (if applicable)?
Dartium

Please provide any additional information below.
I asked a question on it in stackoverflow which should provide more info

http://stackoverflow.com/questions/25154969/extending-paper-item-in-polymer-dart/25155032#&#173;25155032

@kasperl
Copy link

kasperl commented Aug 6, 2014

Added Area-Pkg, Pkg-Polymer, Triaged labels.

@sigmundch
Copy link
Member

There is no support for extending JS elements from Dart - so this is, unfortunately, working as designed.

We should investigate to see if we can add more intuitive error messages though.


Removed Priority-Unassigned label.
Added Priority-Medium, PolymerMilestone-Next labels.

@DartBot
Copy link
Author

DartBot commented Aug 6, 2014

This comment was originally written by @terrasea


I actually am not sure that is 100% correct. You're right that the JS code
part can't be extended, but you should be able to extend the template part.
All you would then require is to make sure the fields specified in the
template exist in the backing class that is created. Am I correct in my
assumption? If I am, then does that not make it possible to at least extend
the visual part?

@jakemac53
Copy link
Contributor

I think it would be to confusing to allow people to extend the template but not the backing class, and its best to just disable it entirely.

There is a workaraound though which I just tested and confirmed can work if you just want to extend the template. Simply add the 'noscript' tag to your element. This actually creates it as a JS element and works just fine for extending the template, see https://gist.github.com/jakemac53/89f9c01f2cb4618fb12c as an example.


Added AsDesigned label.

@DartBot
Copy link
Author

DartBot commented Oct 6, 2014

This comment was originally written by @filiph


Please do provide a better error message here. I just lost an hour trying to extend paper-button before I found this bug.

@DartBot
Copy link
Author

DartBot commented Oct 31, 2014

This comment was originally written by vloz...@gmail.com


I agree with #­5. I wasted my time too... :'(

@DartBot
Copy link
Author

DartBot commented Dec 12, 2014

This comment was originally written by rpurus...@gmail.com


As did I, please update the error message!

@DartBot DartBot added Type-Defect area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. closed-as-intended Closed as the reported issue is expected behavior labels Dec 12, 2014
@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

This issue has been moved to dart-archive/polymer-dart#260.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. closed-as-intended Closed as the reported issue is expected behavior
Projects
None yet
Development

No branches or pull requests

4 participants