diff --git a/angular-formly/angular-formly-tests.ts b/angular-formly/angular-formly-tests.ts index 2374fde4a..01449aa4b 100644 --- a/angular-formly/angular-formly-tests.ts +++ b/angular-formly/angular-formly-tests.ts @@ -20,6 +20,18 @@ class FormConfig { name: 'customInput', extends: 'input' }); + + formlyConfig.disableWarnings = true; + formlyConfig.templateManipulators = undefined; + + formlyConfig.extras.apiCheckInstance = null; + formlyConfig.extras.defaultHideDirective = 'ng-if'; + formlyConfig.extras.disableNgModelAttrsManipulator = true; + formlyConfig.extras.errorExistsAndShouldBeVisibleExpression = angular.noop; + formlyConfig.extras.explicitAsync = true; + formlyConfig.extras.fieldTransform = angular.noop; + formlyConfig.extras.getFieldId = angular.noop; + formlyConfig.extras.ngModelAttrsManipulatorPreferUnbound = true; } } diff --git a/angular-formly/angular-formly.d.ts b/angular-formly/angular-formly.d.ts index 7ee3d3194..f42b35a89 100644 --- a/angular-formly/angular-formly.d.ts +++ b/angular-formly/angular-formly.d.ts @@ -16,15 +16,15 @@ declare module 'angular-formly' { declare module AngularFormly { - interface IFieldArray extends Array { - + interface IFieldArray extends Array { + } interface IFieldGroup { data?: Object; className?: string; elementAttributes?: string; - fieldGroup: IFieldArray; + fieldGroup?: IFieldArray; form?: Object; hide?: boolean; hideExpression?: string | IExpressionFunction; @@ -160,7 +160,7 @@ declare module AngularFormly { */ asyncValidators?: { [key: string]: string | IExpressionFunction | IValidator; - } + }; /** * This is a great way to add custom behavior to a specific field. It is injectable with the $scope of the @@ -210,7 +210,7 @@ declare module AngularFormly { */ expressionProperties?: { [key: string]: string | IExpressionFunction | IValidator; - } + }; /** @@ -219,7 +219,7 @@ declare module AngularFormly { * * see http://docs.angular-formly.com/docs/field-configuration-object#hide-boolean */ - hide?: boolean + hide?: boolean; /** @@ -432,7 +432,7 @@ declare module AngularFormly { */ show?: boolean; - } + }; /** @@ -446,7 +446,7 @@ declare module AngularFormly { */ validators?: { [key: string]: string | IExpressionFunction | IValidator; - } + }; /** @@ -558,10 +558,24 @@ declare module AngularFormly { validateOptions?: Function; } + interface IFormlyConfigExtras { + disableNgModelAttrsManipulator: boolean; + apiCheckInstance: any; + ngModelAttrsManipulatorPreferUnbound: boolean; + removeChromeAutoComplete: boolean; + defaultHideDirective: string; + errorExistsAndShouldBeVisibleExpression: any; + getFieldId: Function; + fieldTransform: Function; + explicitAsync: boolean; + } + interface IFormlyConfig { + disableWarnings: boolean; + extras: IFormlyConfigExtras; setType(typeOptions: ITypeOptions): void; setWrapper(wrapperOptions: IWrapperOptions): void; - + templateManipulators: ITemplateManipulators; } interface ITemplateScopeOptions {