How to create custom angular component

How to create custom angular component

What is custom component

The custom component is different from the component because we can use it on any page. In other words, the custom component acts as a dynamic component.


How to create custom angular component
How to create custom angular component



How to create custom component


First of all, we will create a normal component and then use this component selector in another component.


  1. Create a component. ng g c bottom
  2. Then use selector with tag. <app-bottom></app-bottom> another component.


How to use custom component

<app-top [id]="id" [uid]="uid"></app-top>
<mat-list style="flex: 1 1 auto;">
    <mat-list-item *ngFor="let item of items | async">
        {{item.chat}}
    </mat-list-item>
</mat-list>
<app-bottom></app-bottom>



Previous
Next Post »