I think the only way to do this is a service, but I would like to know if any other way is possible.
Parent:
<h1> Parent title </h1>
<child-element></childElement>
Child:
<form #f="ngForm">
<mat-card-content>
<mat-input-container>
<input matInput [(ngModel)]="id" name="id" placeholder="ID" #input/>
</mat-input-container>
<mat-input-container>
<input matInput [(ngModel)]="name" name="name" placeholder="NAME" #input/>
</mat-input-container>
</mat-card-content>
</form>
From child I can access with @ViewChildren:
export class ChildComponent implements OnInit {
@ViewChildren('input') inputs;
//rest of code
}
but it is possible access all of them in anyway from parent?