Closed vgordievskiy closed 9 years ago
Hmm, this definitely works in general (see test here, so something else is probably going on. Maybe @PolymerRegister('elemnt-test')
is supposed to be @PolymerRegister('element-test')
so its not finding the dom-module
tag (or maybe thats just a type in the issue). If that is not it can you please post a full example?
also - this will only exist in polymer.dart
, not in polymer_mini.dart
or polymer_micro.dart
(see feature list here).
Thanks) It is problem on my side. Was in html -
<dom-module id=="element-test">
Ah yep that makes sense. Unfortunately since a dom-module
is not required we can't really add a check in to make sure that the tag name in PolymerRegister matches a dom-module either :(. Maybe the $
getter could warn if it returns null though?
I think, that some error message on start are enough.
Unfortunately we would have to perform this check inside the $
getter :/. At startup we don't know whether or not a polymer-element is expecting to have a matching dom-module.
In this case a warning in $ getter will be good)
@PolymerRegister('elemnt-test') class ElementTest extends PolymerElement { ElementTest .created() : super.created();
ready() { var test1 = this.$; // test1 is null var test2 = $['some-element-id']; // throw exc }
}