Skip to content

Commit

Permalink
Merge pull request #13 from cloudnc/fix/required-controls-and-control…
Browse files Browse the repository at this point in the history
…s-name

fix(lib): all the props within Controls and ControlsNames interfaces should be required
  • Loading branch information
zakhenry authored Mar 19, 2019
2 parents c2d65ba + 77a0f54 commit 06b3f92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions projects/ngx-sub-form/src/lib/ngx-sub-form-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { AbstractControl, ControlValueAccessor, NG_VALUE_ACCESSOR, NG_VALIDATORS
import { InjectionToken, Type, forwardRef } from '@angular/core';
import { SUB_FORM_COMPONENT_TOKEN } from './ngx-sub-form-tokens';

export type Controls<T> = { [K in keyof T]: AbstractControl };
export type Controls<T> = { [K in keyof T]-?: AbstractControl };

export type ControlsNames<T> = { [K in keyof T]: K };
export type ControlsNames<T> = { [K in keyof T]-?: K };

export function getControlsNames<T extends { [key: string]: any }>(controls: Controls<T>): ControlsNames<T> {
return Object.keys(controls).reduce(
Expand Down

0 comments on commit 06b3f92

Please sign in to comment.