未捕获的错误:模板解析错误:(...)directive

编程入门 行业动态 更新时间:2024-10-26 14:35:30
未捕获的错误:模板解析错误:(...)directive_normalizer.js:92(Uncaught Error: Template parse errors:(…) directive_normalizer.js:92)

在Ionic 2中(并且猜测它对于常规的Angular 2也是如此),正如我开发的那样,我经常运行这个错误: Uncaught Error: Template parse errors:(…) directive_normalizer.js:92 。

起初我没有得到它(同样,错误消息中的Template这个词与搜索的位置很相关),但是我已经解决了它,并且会留下我的评论以防止人们对这个问题有所了解。

所以我提前道歉 :没有代码,我会回答我自己的问题。

In Ionic 2 (and guess it is true with regular Angular 2 as well), as I develop, I often run in that error: Uncaught Error: Template parse errors:(…) directive_normalizer.js:92.

At first I did not get it (also the word Template in the error message is quite relevant about where to search), but I've solved it and will leave my remarks here in case it can save time to people wondering about that issue.

So I appologize in advance: no code and I will answer my own question.

最满意答案

它指的是在调用的html模板文件中的一个错字错误。

在你的页面上,在@Component中你有这样的东西:

@Component{ ... templateUrl: "your-template-file.html", ... }

错误是因为在类似于“your-template-file.html”的文件中存在拼写错误:就像一个被忘记关闭的标记或另一个HTML不一致的语法。

另外,您可能会错误地关闭指令的标记,例如<my-tag/> ,而不是<my-tag></my-tag> 。

It refers to a typo error in one of the html template file called.

On your pages, in the @Component you have something like:

@Component{ ... templateUrl: "your-template-file.html", ... }

The error is raised because there is a typo error in one the files similar to "your-template-file.html": like one tag which has been forgotten to be closed, or another HTML inconsistent syntax.

Also, you might be closing the directive's tag incorrectly, e.g. <my-tag/> as opposed to <my-tag></my-tag>.

更多推荐

本文发布于:2023-08-05 05:52:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1428253.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   模板   directive

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!