Skip to content

Commit b424cdf

Browse files
committed
fix(lib): data input decorator has a type error when used with an array
This closes #83
1 parent 96fa4e8 commit b424cdf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

projects/ngx-sub-form/src/lib/ngx-sub-form.decorators.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@ export class DataInputUsedOnWrongPropertyError extends Error {
99
}
1010

1111
export function DataInput() {
12-
return function(target: NgxRootFormComponent<any, any>, propertyKey: string) {
12+
return function<ControlInterface, FormInterface = ControlInterface>(
13+
target: NgxRootFormComponent<ControlInterface, FormInterface>,
14+
propertyKey: string,
15+
) {
1316
if (propertyKey !== 'dataInput') {
1417
throw new DataInputUsedOnWrongPropertyError(propertyKey);
1518
}
1619

1720
Object.defineProperty(target, propertyKey, {
1821
set: function(dataInputValue) {
19-
(this as NgxRootFormComponent<any, any>).dataInputUpdated(dataInputValue);
22+
(this as NgxRootFormComponent<ControlInterface, FormInterface>).dataInputUpdated(dataInputValue);
2023
},
2124
});
2225
};

0 commit comments

Comments
 (0)