【发布时间】:2017-02-21 14:17:24
【问题描述】:
我刚刚从 RC 4 升级到 Angular 2 Final Release,现在我的代码出现错误 cannot find name 'module':
@Component({
selector: 'dashboard',
moduleId: module.id,
templateUrl: 'dashboard.component.html',
styleUrls: ['dashboard.component.css'],
styles: ['.chart {display: block; width: 100%;} .title.handle{background-color:transparent;}']
})
有什么想法吗?
提前致谢!
更新,这是错误:
zone.js:355 Unhandled Promise rejection: Template parse errors:
Only void and foreign elements can be self closed "span" ("i role="presentation"><a role="menuitem" tabindex="-1" href="http://BruinAlert.ucla.edu">BruinAlert [ERROR ->]<span class="icon-external-link" /></a></li>
<li role="presentat"): WidgetBankComponent@104:138
Only void and foreign elements can be self closed "span" ("tion"><a role="menuitem" tabindex="-1" href="https://logon.ucla.edu/passchange.php">Change Password [ERROR ->]<span class="icon-external-link" /></a></li>
at DirectiveNormalizer.normalizeLoadedTemplate (http://localhost:56159/node_modules/@angular/compiler//bundles/compiler.umd.js:13373:21)
at eval (http://localhost:56159/node_modules/@angular/compiler//bundles/compiler.umd.js:13366:53)
at ZoneDelegate.invoke (http://localhost:56159/node_modules/zone.js/dist/zone.js:203:28)
at Zone.run (http://localhost:56159/node_modules/zone.js/dist/zone.js:96:43)
at http://localhost:56159/node_modules/zone.js/dist/zone.js:462:57
at ZoneDelegate.invokeTask (http://localhost:56159/node_modules/zone.js/dist/zone.js:236:37)
at Zone.runTask (http://localhost:56159/node_modules/zone.js/dist/zone.js:136:47)
at drainMicroTaskQueue (http://localhost:56159/node_modules/zone.js/dist/zone.js:368:35)
at XMLHttpRequest.ZoneTask.invoke (http://localhost:56159/node_modules/zone.js/dist/zone.js:308:25)consoleError @ zone.js:355_loop_1 @ zone.js:382drainMicroTaskQueue @ zone.js:386ZoneTask.invoke @ zone.js:308
zone.js:357 Error: Uncaught (in promise): Error: Template parse errors:(…)consoleError @ zone.js:357_loop_1 @ zone.js:382drainMicroTaskQueue @ zone.js:386ZoneTask.invoke @ zone.js:308
【问题讨论】:
-
我的答案已经更新,请查收