无效字符错误:“fred” [英] InvalidCharacterError: "fred"
问题描述
我相信他一定是个新手问题。简单来说,我想定义我的第一个Polymer-dart组件。只有我继续踢我的脚趾在同样的速度驼峰。
I am sure his must be a newbie question. In simple terms I wanted to define my first Polymer-dart component. Only I keep kicking my toe on the same speed-hump. To keep things very simple, I've stripped it back to a very simple example.
我做了一个简单的 重命名 strong>示例:Dart组件中的'秒表组件Polymer-dart教程:
I did a simple rename of the example: 'stopwatch'component from the Dart component Polymer-dart tutorial:
我有类似问题标题中的错误,因此重命名的组件是:
I had errors similar to the one in the question title, so the renamed component is:
- ' fred '...从:' tute-stopwatch '
- 'fred' ... from: 'tute-stopwatch'
这样做后,我得到下面的错误跟踪。它看起来我的名字是我的问题。我通过在每次增量更改后运行示例(还能做什么?)来确认。我保留了文件名:
When this is done, I get the error trace below. It looks to me that the name is my problem. I confirmed this by running the example after each incremental change (what else can you do?). I retained the file names:
- tute_stopwatch.html
- tute_stopwatch.dart
从示例中,只更改了组件标签名称。这意味着3个文件中的更改。
From the example, and only changed the component label name. That means a change in 3 x files.
- index.html
- < fred >< / fred >
- >:< tute-stopwatch>< / tute-stopwatch>
- < fred >< / fred >
- index.html
- <fred></fred>
- from: <tute-stopwatch></tute-stopwatch>
- <fred></fred>
- < polymer-element name = fred >
- 来自:< polymer -element name =tute-stopwatch>
- <polymer-element name="fred">
- from: <polymer-element name="tute-stopwatch">
- li> @CustomTag(' fred ')
- :@CustomTag('tute-stopwatch')
-
- @CustomTag('fred')
- from: @CustomTag('tute-stopwatch')
对于一个简单的更改,必须更新三个( 3 )的东西是理想的,它仍然非常基本,
Although, I can't say having to update three(3) things for one simple change is ideal, it is still very basic and very simple to 'make' a new element with Polymer-dart once you have a model definition.
除了,有什么问题吗? 我想我可以问的第二个问题是:
Apart from, what went wrong? I guess a second question I can ask is, what does the:
- '类型名称无效。 '... 平均?
- 'The type name is invalid.' ... Mean?
问题确实是一个新手问题。然而,由于'解决方案'不明显或直观,我错过了一些东西。哦,错误使没有感觉(对纯粹的凡人)。 Muy gracias ...
The question is decidedly a newbie question. However because the 'solution' is not obvious or intuitive, I've missed something. Oh and the error makes No Sense (to mere mortals). Muy gracias ...
Uncaught Error: InvalidCharacterError: Registration failed for type 'fred'. The type name is invalid. Stack Trace: #0 _Utils._register (file:///E:/b/build/slave/dartium-win-full-stable/build/src/dart/tools/dom/src/native_DOMImplementation.dart:450) #1 _Utils.register (file:///E:/b/build/slave/dartium-win-full-stable/build/src/dart/tools/dom/src/native_DOMImplementation.dart:446) #2 HtmlDocument.register (file:///E:/b/build/slave/dartium-win-full-stable/build/src/build/Release/obj/global_intermediate/blink/bindings/dart/dart/html/HtmlDocument.dart:266) #3 PolymerDeclaration.registerType (package:polymer/src/declaration.dart:241:22) #4 PolymerDeclaration.register (package:polymer/src/declaration.dart:164:17) #5 PolymerDeclaration._register (package:polymer/src/declaration.dart:114:13) #6 PolymerDeclaration.registerWhenReady (package:polymer/src/declaration.dart:109:14) #7 _notifyType (package:polymer/src/declaration.dart:476:49) #8 Polymer.register (package:polymer/src/instance.dart:65:16) #9 _loadLibrary (package:polymer/src/loader.dart:196:25) #10 _loadLibraries (package:polymer/src/loader.dart:89:19) #11 _initPolymerOptimized (package:polymer/src/loader.dart:54:17) #12 _rootRun (dart:async/zone.dart:710) #13 _ZoneDelegate.run (dart:async/zone.dart:440) #14 _CustomizedZone.run (dart:async/zone.dart:650) #15 initPolymer (package:polymer/src/loader.dart:37:33) #16 main (package:polymer/init.dart:23:22) Exception: InvalidCharacterError: Registration failed for type 'fred'. The type name is invalid. undefined (undefined:0:0)
推荐答案
的聚合物元素必须包含破折号,以便将它们与标准DOM元素区分开来。
The tag name of polymer elements must contain a dash to differentiate them from standard DOM elements.
这篇关于无效字符错误:“fred”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!