You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the various Vendr views I noticed some angular directives/components, which are void elements (self-closing).
For example:
<vendr-license-check /> and <umb-checkbox /> (e.g. inside vendrFilter directive).
However angular directives/components can't be self-closing, since these are custom HTML elements.
There is a great explanation of it here: https://stackoverflow.com/a/25012451/1693918
The browser's parser has to listen to the spec. Since using the slash in a non-void element tag is invalid, the parser ignores the ending />, and means . Therefore you are never closing the first element which prevents the others to work.
The browser's parser has to listen to the spec. Since using the slash in a non-void element tag is invalid, the parser ignores the ending />, and means . Therefore you are never closing the first element which prevents the others to work.
Just a note to myself that I'll need to check the grunt build task as well as the source code to make sure it's not this that is minimizing the tags to their self closing counterpart.
PS technically all directives end up being inline as we have a build process that actually reads the directive view files and inlines them. This is to save on the performance of having to load extra html files. We could move the template to a HTML file to make source code easier to navigate, but I don't think that affects users really.
In the various Vendr views I noticed some angular directives/components, which are void elements (self-closing).
For example:
<vendr-license-check />
and<umb-checkbox />
(e.g. insidevendrFilter
directive).However angular directives/components can't be self-closing, since these are custom HTML elements.
There is a great explanation of it here: https://stackoverflow.com/a/25012451/1693918
Furthermore this comment: https://stackoverflow.com/a/31724215/1693918
The browser's parser has to listen to the spec. Since using the slash in a non-void element tag is invalid, the parser ignores the ending />, and means . Therefore you are never closing the first element which prevents the others to work.
Here are some examples from Umbraco core where this caused issues:
umbraco/Umbraco-CMS#8478
umbraco/Umbraco-CMS#8605
I would therefore recommend always to use a end-closing tag:
<vendr-license-check></vendr-license-check>
<umb-checkbox></umb-checkbox>
etc.Regarding
vendrFilter
directive I noticed it has quite a lot of inline template markup, maybe move this to a separate view?The text was updated successfully, but these errors were encountered: