timdeschryver / ng-signal-forms

105 stars 7 forks source link

Getting the error : NG8002: Can't bind to 'formField' since it isn't a known property of 'input'. #41

Closed JulienLecoq closed 2 months ago

JulienLecoq commented 2 months ago

I tried a basic example with just the following code in the template:

<div>
    <label>Name</label>
    <input
        ngModel
        [formField]="form.controls.email"/>
</div>

And I'm getting this error (the one from the title).

The FormsModule is imported inside the imports: [] array.

I have no idea what cause this issue, any idea?

michael-small commented 2 months ago

Have you imported the SignalInputDirective? Example: https://github.com/timdeschryver/ng-signal-forms/blob/main/apps%2Fexample%2Fsrc%2Fapp%2Fbasic-form%2Fbasic-form.component.ts

JulienLecoq commented 2 months ago

Ah right, that was the issue.