Search code examples
htmlangularangular5

'hgroup' is not a known element error in Angular 5


I'm getting this error on using the tag in the *.component.html, however on removing the element the code works fine, what is the reason behind it? Uncaught Error: Template parse errors: 'hgroup' is not a known element:

  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....


Solution

  • Acording to 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, ...

    So I suggest you remove hgroup element from your html code and use CSS to achieve same styling as you might get different styling in different browsers.

    You should also checkout Subheadings, subtitles, alternative titles and taglines without using <hgroup>