Reputation: 115
I have this imbrication of component
<form [formGroup]="form" novalidate autocomplete="off" (ngSubmit)="onSubmit()">
<app-form-field label="Input" [required]="true" [control]="form.controls['input']">
<app-input formControlName="input"></app-input>
</app-form-field>
</form>
How can i remove the app-input angular selector and just keeping input tag please?
I need this for works with ~ or > css operator
Thanks for your help
Upvotes: 0
Views: 249
Reputation: 1771
You can't remove the <app-input>
selector, but there may be other solutions to your problem:
<app-input>
that you need, just replace this with a native <input>
. formControlName
will work on native <input>
tags out of the box (as long as you have imported the ReactiveFormsModule
), you don't always need a componentapp-input
component
>
or ~
to specifically target the elements you want to style no matter how they are nested<form [formGroup]="form">
<app-form-field>
<app-input formControlName="input" class="form-control"></app-input>
</app-form-field>
<app-form-field>
<input type="checkbox" formControlName="input2" class="form-control" />
</app-form-field>
<input type="radio" formControlName="input3" class="form-control" />
</form>
form app-form-field > *,
form app-form-field app-input input {
// your style
}
Upvotes: 0