This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix($compileProvider): remove the ability to set the
restrict
optio…
…n on `component()` helper Closes #13741
- Loading branch information
1 parent
4e1b36c
commit 25bc531
Showing
2 changed files
with
8 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25bc531
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is only element possible? It can change the DOM structure which could be important for SEO.
25bc531
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AIMMOTH we feel that "component" directives are always elements. Can you explain how this impacts SEO in practice? Be aware that if you want a directive that is not an element then you are still free to use the
mod.directive(...)
helper25bc531
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@petebacondarwin Recommendations is that the DOM structure should be arranged for SEO. For instance
<article></article>
should be used. If this article is a component, it was possible to add the component as attribute<article component></article>
but now you need to destroy DOM structure with<component></component>
Or have I missed something?
25bc531
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated last comment.
There is some information in this blog http://www.icrossing.com/uk/ideas/html5s-new-semantic-tags-whats-seo-value
25bc531
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AIMMOTH, I can't find any info or guideline suggesting that
<article my-component>…</article>
is any more SEO-friendly than<my-component><article>…</article></my-component>
.Do you have any insight on this ?
25bc531
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course there are workarounds. And your solution is perfectly valid.
Here's a second blog http://www.gravitatedesign.com/blog/seo-benefits-of-html5-and-schema/
25bc531
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I've read, I don't understand that wrapping
<article>
in a<my-component>
element hurts SEO.AFAIK, the purpose of those semantic elements is to better convey the purpose of a part of the webpage. I don't think that having them wrapped in non-semantic elements (such as
<my-component>
) affects that.(I might be wrong, though...)
IMO,
<my-component><article /></my-component>
isn't a workaround;<article my-component></article>
on the other hand does look a bit "hacky". And with Web Components being a thing, I doubt that custom elements would be "frowned upon" by search engines.And, of cource, one can always use plain ol' directives (with
restrict: 'A'
) 😃25bc531
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. The best way migth be
<article><my-component></my-component></article>