Skip to content

Instantly share code, notes, and snippets.

@alexzuza
Created October 14, 2017 18:21
Show Gist options
  • Save alexzuza/c467496e1893281046646140fdb43552 to your computer and use it in GitHub Desktop.
Save alexzuza/c467496e1893281046646140fdb43552 to your computer and use it in GitHub Desktop.
export const formDirectiveProvider: any = {
provide: ControlContainer,
useExisting: forwardRef(() => NgForm)
};
...
@Directive({
selector: 'form:not([ngNoForm]):not([formGroup]),ngForm,[ngForm]',
providers: [formDirectiveProvider],
...
exportAs: 'ngForm'
})
export class NgForm extends ControlContainer implements Form {
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment