Skip to content

Commit 3dc2ce1

Browse files
committed
Changed type of "data" to { [key: string]: any; }
Changed the type of the data property on the IFieldGroup, ITypeOptions, IFormOptionsAPI, and IFieldConfigurationObject interfaces from "Object" to a hash of string to any. While Object was not incorrect, it made use without a cast a type error in all but the most trivial cases.
1 parent dade441 commit 3dc2ce1

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

angular-formly/angular-formly.d.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ declare module AngularFormly {
2121
}
2222

2323
interface IFieldGroup {
24-
data?: Object;
24+
data?: {
25+
[key: string]: any;
26+
};
2527
className?: string;
2628
elementAttributes?: string;
2729
fieldGroup?: IFieldArray;
@@ -37,7 +39,9 @@ declare module AngularFormly {
3739

3840

3941
interface IFormOptionsAPI {
40-
data?: Object;
42+
data?: {
43+
[key: string]: any;
44+
};
4145
fieldTransform?: Function;
4246
formState?: Object;
4347
removeChromeAutoComplete?: boolean;
@@ -177,7 +181,9 @@ declare module AngularFormly {
177181
*
178182
* see http://docs.angular-formly.com/docs/field-configuration-object#data-object
179183
*/
180-
data?: Object;
184+
data?: {
185+
[key: string]: any;
186+
};
181187

182188

183189
/**
@@ -536,7 +542,9 @@ declare module AngularFormly {
536542
apiCheckOptions?: Object;
537543
defaultOptions?: IFieldConfigurationObject | Function;
538544
controller?: Function | string | any[];
539-
data?: Object;
545+
data?: {
546+
[key: string]: any;
547+
};
540548
extends?: string;
541549
link?: ng.IDirectiveLinkFn;
542550
overwriteOk?: boolean;

0 commit comments

Comments
 (0)