diff --git a/packages/form/package.json b/packages/form/package.json index 06c331af..746c8dc8 100644 --- a/packages/form/package.json +++ b/packages/form/package.json @@ -69,6 +69,7 @@ "prepublish": "npm run build" }, "main": "dist/source/index.js", + "typings": "dist/source/index.d.ts", "repository": "https://github.com/angular-redux/form", "license": "MIT" } diff --git a/packages/form/source/connect-array.ts b/packages/form/source/connect-array.ts index dd960a5b..61c52be7 100644 --- a/packages/form/source/connect-array.ts +++ b/packages/form/source/connect-array.ts @@ -111,11 +111,11 @@ export class ConnectArray extends ControlContainer implements OnInit { return controlPath(this.key, this.parent); } - get validator(): ValidatorFn { + get validator(): ValidatorFn | null { return Validators.compose(this.rawValidators); } - get asyncValidator(): AsyncValidatorFn { + get asyncValidator(): AsyncValidatorFn | null { return Validators.composeAsync(this.rawAsyncValidators); } diff --git a/packages/form/source/shims.ts b/packages/form/source/shims.ts index 9fef323a..b61f5d23 100644 --- a/packages/form/source/shims.ts +++ b/packages/form/source/shims.ts @@ -10,7 +10,7 @@ import { } from '@angular/forms'; export function controlPath(name: string, parent: ControlContainer): string[] { - return [...parent.path, name]; + return [...(parent.path || []), name]; } export function selectValueAccessor( diff --git a/packages/form/tsconfig.json b/packages/form/tsconfig.json index a9317fd4..13d274dd 100644 --- a/packages/form/tsconfig.json +++ b/packages/form/tsconfig.json @@ -26,7 +26,10 @@ "useBabel": true, "useCache": false }, - "angularCompilerOptions": {}, + "angularCompilerOptions": { + "strictMetadataEmit": true, + "skipTemplateCodegen": true + }, "exclude": [ "node_modules", "dist",