docs: edit styleguide recommendation on components as elements (#22074)

Change recommendation on using attributes for components since there are use cases including the use of <button mat-button> in MD

Closes #19401.

PR Close #22074
This commit is contained in:
Kapunahele Wong 2018-02-06 16:02:19 -05:00 committed by Victor Berchet
parent e86b64b620
commit a4f9e8180b
1 changed files with 5 additions and 4 deletions

View File

@ -3773,8 +3773,7 @@ A typical *lazy loaded folder* contains a *routing component*, its child compone
<div class="s-rule do">
**Do** give components an _element_ selector, as opposed to _attribute_ or _class_ selectors.
**Consider** giving components an _element_ selector, as opposed to _attribute_ or _class_ selectors.
</div>
@ -3803,7 +3802,11 @@ Developers place components on the page as they would native HTML elements and w
</div>
<div class="l-sub-section">
There are a few cases where you give a component an attribute, such as when you want to augment a built-in element. For example, [Material Design](https://material.angular.io/components/button/overview) uses this technique with `<button mat-button>`. However, you wouldn't use this technique on a custom element.
</div>
<code-example path="styleguide/src/05-03/app/heroes/shared/hero-button/hero-button.component.avoid.ts" region="example" title="app/heroes/hero-button/hero-button.component.ts">
@ -3819,8 +3822,6 @@ Developers place components on the page as they would native HTML elements and w
<code-tabs>
<code-pane title="app/heroes/shared/hero-button/hero-button.component.ts" path="styleguide/src/05-03/app/heroes/shared/hero-button/hero-button.component.ts" region="example">