-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Open
Labels
Milestone
Description
Which @angular/* package(s) are relevant/related to the feature request?
forms
Description
It would be nice, if possible, to mark the FormControlDirective as a standalone component. That way it can be used as hostDirective in other components. For instance, we are using it (with workaround), to dynamically render and bind form-inputs.
Currently the following error is shown when the directive is used as host-directive.
[ERROR] TS-992014: Host directive FormControlDirective must be standalone [plugin angular-compiler]
With the following piece of code
hostDirectives: [ {
directive: FormControlDirective,
inputs: [ 'formControl' ]
} ]
Proposed solution
Mark FormControlDirective as standalone
Alternatives considered
Currently we extend the FormControlDirective, so it can be marked to as standalone without any other changes. That custom component we can than use as HostDirective.
import { Directive } from '@angular/core';
import { FormControlDirective } from '@angular/forms';
@Directive( {
standalone: true
} )
export class HostFormControlDirective extends FormControlDirective {
}
Reactions are currently unavailable
