Skip to content

Instantly share code, notes, and snippets.

View abbazabacto's full-sized avatar

Bart Meinders abbazabacto

View GitHub Profile
@abbazabacto
abbazabacto / form-builder-typed.ts
Last active March 20, 2022 13:17
Typed Form Builder
// extended upon: https://ruanbeukes.net/Angular-Typesafe-Reactive-Forms/
import { Injectable } from '@angular/core';
import { AbstractControl, FormArray, FormControl, FormGroup, ValidatorFn, AsyncValidatorFn, FormBuilder } from '@angular/forms';
import { Observable } from 'rxjs/Observable';
type PropertyFn<T, R> = (val: T) => R;
interface AbstractControlTyped<T> extends AbstractControl {
readonly value: T;