在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>.
更多推荐
发布评论