I created a lit-element web component that contains an <input type="text">
. Actually I just extended LionInput.
import { InputMixin } from '@core/mixin/form/InputMixin';
import { customElement} from '@lion/core';
import { LionInput } from '@lion/input';
@customElement('ds-input')
export class DSInput extends InputMixin(LionInput) {}
Inside app.module of my Angular app I added the schemas property:
schemas: [CUSTOM_ELEMENTS_SCHEMA],
As you can see in the image below, <my-input>
is recognised as web component inside my angular reative form
The problem is when I try to reach the <input>
inside my web component doing this:
<form [formGroup]="myForm">
<ds-input [formControlName]="'name'"></ds-input>
</form>
this.myForm = new FormGroup({
name: new FormControl()
});
I get the error:
'ERROR Error: No value accessor for form control with name: 'name'
I perfectly understand the reason of the error, but I can't understand how to solve it, how to make Angular reach the <input>
inside <ds-input>
I don't find much documentation about how to integrate litElement web component inside an Angular app.