How To Put HTMLElement Inside Component Like Angular Material does

久保圭司

In AngularMaterial, I saw code like this.

<form class="example-form">
  <mat-form-field class="example-full-width">
    <input matInput placeholder="Favorite food" value="Sushi">
  </mat-form-field>
</form>

There are <input> element inside <mat-form-field> component.

Usually, when I wrote element inside component, It wil be ignored.

How can I do this.

红了樱桃绿了吧唧

Using <ng-content></ng-content> to slot your element.

https://medium.com/claritydesignsystem/ng-content-the-hidden-docs-96a29d70d11b

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Javascript

iframe inside angular2 component, Property 'contentWindow' does not exist on type 'HTMLElement'

From Javascript

How do I put a clear button inside my HTML text input box like the iPhone does?

From Dev

How to show a HTML Dom/ Angular Component inside a Angular component?

From

How to put a component inside another component in Angular2?

From Dev

Property 'ripples' does not exist on type 'JQuery<HTMLElement>'. in angular component

From Dev

How to put React component inside HTML string?

From Dev

How does the following `src='${loadingGif}'` work inside angular component

From Dev

How do you put an image inside of an Angular2 Material fab button?

From Dev

How to put icon in placeholder in Angular Material?

From Dev

How to apply styles for tree component of angular material

From Dev

angular 2 - How to get HTMLElement / ElementRef of child component using template reference variable?

From Dev

component inside component Angular

From Dev

To call a component inside Dialog component in angular material

From Dev

NODEJS mongodb how to put variable inside like query

From Dev

How to switch component in angular 5 like template?

From Dev

How to use in Angular Material List an Item component

From Dev

How to toggle angular material sidenav in component

From Dev

How to render angular material tags from JSON response inside angular component?

From Dev

How do I create an HtmlElement Reference in an Angular component?

From Dev

How to add specific styles of an Angular Material component

From Dev

How to put conditions inside angular data binding?

From Dev

How to show Angular Material Tooltip on component initialization

From Dev

How to listen to mousemove inside angular material dialog component?

From Dev

How to put a component inside the host container of a directive in Angular 2?

From Dev

How to display a HTMLElement from a variable in an Angular component?

From Dev

How to put a React Component Inside a nest of StyledComponents

From Dev

How to put back HTMLElement into React component after the was (re)moved without React

From Dev

Angular Material: How to close MatSidenav from inside a method in the component instead of from the html?

From Dev

The difference : put Material-UI MakeStyles const outside vs inside functional component

Related Related

  1. 1

    iframe inside angular2 component, Property 'contentWindow' does not exist on type 'HTMLElement'

  2. 2

    How do I put a clear button inside my HTML text input box like the iPhone does?

  3. 3

    How to show a HTML Dom/ Angular Component inside a Angular component?

  4. 4

    How to put a component inside another component in Angular2?

  5. 5

    Property 'ripples' does not exist on type 'JQuery<HTMLElement>'. in angular component

  6. 6

    How to put React component inside HTML string?

  7. 7

    How does the following `src='${loadingGif}'` work inside angular component

  8. 8

    How do you put an image inside of an Angular2 Material fab button?

  9. 9

    How to put icon in placeholder in Angular Material?

  10. 10

    How to apply styles for tree component of angular material

  11. 11

    angular 2 - How to get HTMLElement / ElementRef of child component using template reference variable?

  12. 12

    component inside component Angular

  13. 13

    To call a component inside Dialog component in angular material

  14. 14

    NODEJS mongodb how to put variable inside like query

  15. 15

    How to switch component in angular 5 like template?

  16. 16

    How to use in Angular Material List an Item component

  17. 17

    How to toggle angular material sidenav in component

  18. 18

    How to render angular material tags from JSON response inside angular component?

  19. 19

    How do I create an HtmlElement Reference in an Angular component?

  20. 20

    How to add specific styles of an Angular Material component

  21. 21

    How to put conditions inside angular data binding?

  22. 22

    How to show Angular Material Tooltip on component initialization

  23. 23

    How to listen to mousemove inside angular material dialog component?

  24. 24

    How to put a component inside the host container of a directive in Angular 2?

  25. 25

    How to display a HTMLElement from a variable in an Angular component?

  26. 26

    How to put a React Component Inside a nest of StyledComponents

  27. 27

    How to put back HTMLElement into React component after the was (re)moved without React

  28. 28

    Angular Material: How to close MatSidenav from inside a method in the component instead of from the html?

  29. 29

    The difference : put Material-UI MakeStyles const outside vs inside functional component

HotTag

Archive