html - 'hgroup' 不是 Angular 5 中的已知元素错误

标签 html angular angular5

我在使用标签时遇到了这个错误 *.component.html,但是在删除元素时代码工作正常,背后的原因是什么? Uncaught Error :模板 解析错误:“hgroup”不是已知元素:

  1. If 'hgroup' is an Angular component, then verify that it is part of this module.

  2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component....

最佳答案

根据 MDN

The element has been removed from the HTML5 (W3C) specification, but it still is in the WHATWG version of HTML. It is partially implemented in most browsers, ...

所以我建议你删除hgroup从您的 html 代码中提取元素并使用 CSS 实现相同的样式,因为您可能会在不同的浏览器中获得不同的样式。

您还应该查看 Subheadings, subtitles, alternative titles and taglines without using <hgroup>

关于html - 'hgroup' 不是 Angular 5 中的已知元素错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48061841/

相关文章:

javascript - 无法在 Angular 5 npm 包中传递 @Input 变量(使用 ng-packagr 创建)

javascript - HTML 数据和一个看起来像数字的字符串

html - btn-group 创建第一个按钮太高

angular - 让 moment.js 远离我的 Angular 构建输出

css - Angular 2/4 如何确定在动画之前/之后内联放置哪些样式?

javascript - 如何将数据服务传递到 Angular 5中的组件中

html - 修复使用 :after 时出现在 LI 元素上的间隙

javascript - 使用 Javascript 将段落从外部 HTML 页面插入到另一个 HTML 页面

不允许 Angular2 多个构造函数实现 TS2392

javascript - Angular 4/5 中的事件处理程序性能问题