问题
I've try to use core-icon and layout element. When I import core-icons.html, there's some error..
Uncaught TypeError: prototype.registerCallback is not a function
and there is any element display on the page.
What should I do to fix it. - Using Polymer 0.9 and Elements (0.5)
回答1:
Core Elements are not compatible with Polymer 0.9. Use iron-elements instead.
回答2:
So I got the same error when I started using version 1.0 of Polymer. Apparently I was using old syntax.
version 0.5 syntax:
Polymer('shape-menu',{
shapes: ['a'],
...
version 1.0 syntax:
Polymer({
is:"shape-menu",
shapes: ['a'],
...
回答3:
During upgrade from very old Polymer to Polymer v1.7.0 I received this same error. To fix I noticed that I had accidentally migrated a function into the "properties" section rather than as a sibling to the "properties".
Broken:
<script>
Polymer({
is: 'my-comp',
properties: {
myprop: 'my value',
myfunction: function(){
...
},
},
});
</script>
Fixed:
<script>
Polymer({
is: 'my-comp',
properties: {
myprop: 'my value',
},
myfunction: function(){
...
},
});
</script>
Even though this question is marked as answered I thought this alternate fix might be useful to someone having this error for the same reason I did.
来源:https://stackoverflow.com/questions/30431606/prototype-registercallback-is-not-a-function-in-polymer