- I guess I didn't actually fix the
peerDependencieslike I thought I had... Don't test something, then change it without testing again...
- Updating error messaging for when a type has no template or templateUrl.
- Fixing the URL for error messages
- Fixing issue with
peerDependencies(npm) anddependencies(bower) where you were unable to install the beta versions of angular.
- Allowing the use of validators as formlyExpressions (both strings and functions)
- Adding
apiCheckOptions
- Adding
apiCheckand it's kidsapiCheckInstanceandapiCheckFunction.
- Fixing bower dependency with api-check rename
- Fixing issue with external dependencies
formly-formnow takesoptionswhich can specifyformDatawhich will be passed to the field on the newform-dataattribute. This is useful for sharing data between fields. (#187)formlyConfig.setWrappernow allows you to specifyvalidateOptionswhich will be used similar totype.validateOptions. (#192)
- Upgrading api-check to create a custom instance of api-check. This comes with a breaking change. formly used to add
apiCheckas a constant but no longer does. Instead, it addsformlyApiCheckas a constant and that is the instance of apiCheck forangular-formly.
- wrapper apiCheck was incorrect for
setType. - no longer shipping with lodash... whoops :-/
- Bug fix (#188). The
options.messagestype was wrong.
- Updated
api-checkto 3.0.0. It's awesome. Also added field checking to types.
api-checkis now a dependency of angular-formly. It is bundled withangular-formlyto prevent a breaking change andangular-formlyexposes it as an injectable constant viaapiCheck.formlyConfig.setTypenow allows you to specifyvalidateOptionswhich will pass the user's specified options for validation. The author is responsible for logging warnings or throwing errors. Recommended to useapiCheck.jswhich will be shipped as a dependency forangular-formlysoon. This also supportsextends.
formly-formno longer throwing an error when thescope.modelis falsey.formlyConfig.setTypeno longer throws an error when you neglect to specify atemplate,templateUrl, ordefaultOptionsbecause withextendsyou could create a type that's meant to be extended.
- Evidently...
angular.isBooleandoes not exist...
- Introducing
showErroras a scope variable informly-fields. It's a shortcut foroptions.validation.errorExistsAndShouldBeVisible. Also, fixing an issue where a non-boolean value forvalidation.showwould be used. Also,validation.showwill only set these totrueif the form control is also$invalidwhich was the original intent.
- The
extendsfordefaultOptionsin the case where both were functions was not calling the child properly. It was calling with the parent's result, but it should be called with the parent's result merged with the options.
- Because the attribute html
maxlengthprevents the user from inputing anything longer than the specified length,formlyNgModelAttrsManipulatorallows you to specify that you want to use theboundversion only (i.e.ng-maxlength). This adds a watcher, but is a better user experience. SetformlyConfig.extras.ngModelAttrsManipulatorPreferBound = trueto enable this.
Missed something sorta crutial in that last release...
formly-field's scope propertyoptions.validation.errorExistsAndShouldBeVisiblewasn't giving preference tovalidation.showand it should. Also, only adding the watcher when a formControl is set on the field's options.
togets set in the scope of theformly-fieldBEFORE controllers are invoked so the controllers can referencetoas well.- a new variable gets added to the scope called
fcwhich is a shortcut forscope.options.formControl.
setTypenow allows a new property calledextendswhich allows you to extend the functionality of other types. It even handleslink,controller, anddefaultOptionsfunctions really nicely. This is an awesome addition!setTypenow throws errors if you specify anything but the allowed properties for types which further helps you use formly correctly.- The error/warning url now points to a file that's in the repo which ensures that the warning and error descriptions will live with the code they were written for.
formlyNgModelAttrsManipulatorwas not allowing specifying the value of0because falsiness funniness of JavaScript (-‸ლ)
formly-fieldfields were supposed to be able to specifynullas thewrapperproperty. This was not the case and has been updated (with tests to prevent this from surfacing again).
formlyUtil.reverseDeepMergefixes. There were issues withdefaultOptionsoverriding the specified options. This fixes those issues.
formly-fieldconvenience scope variabletogot messed up when usingdefaultOptionsfor types. This version fixes that.
formly-fieldnow adds a convenience scope variabletoto scope which is just pointing tooptions.templateOptions. This should make the templates a little more terse (albeit maybe a little less obvious to read).
expressionPropertiesnever actually passed the$viewValueto be used in the expressions. This was ok because in this context you could just use$modelValue, but we want to keep our expressions as consistent as possible so this bug was fixed.
ngModelAttrshas had an api change. The new api is complex, but much more powerful and useful. Few are using the original api as it's brand new, so I decided to not make a new major version.
- 3.0.11 didn't have a full build...
validatorsnow supports async validators in 1.2. The API is identical between the two. It also emulates$pending.
- Fixed some mistakes in the README.md
validatorsapi validation was not checking if the validator was a string (as in, an expression) and was throwing an error if it was.
ngModelAttrsManipulatorwas not applying theinvokableattributes properly.
formly-fieldnow adds a new object the the field config calledvalidationwhich has a few useful properties:showwhich is specified by the user andmessagesanderrorExistsAndShouldBeVisiblewhich is set by formly.formlyConfignow hasextras.disableNgModelAttrsManipulatorwhich can be used to disable thengModelAttrsManipulator. Let me know if you want to do this and maybe we can fix the manipulator for your use case.
formly-fieldrunExpressionnow runs inside a$timeoutto ensure that the value is current
formly-formswitching theno-root-elattribute for a new attribute calledroot-elwhich can be used to control the root element of a formly-form. Defaults to anng-formbut if you wish, you can change it to aformby specifyingroot-el="form"or adivby specifyingroot-el="div". I believe only one person was using this feature, so I decided to not make a major version change for this #politics
- Allowing validators to be specified as objects that have
expressionandmessageson them. This is opening the way for including built-in support forng-messagesin the future. For now, templates can supportng-messageswith this enhanced api. Specifying a validator the old way works just fine. - When a validator has a
messageproperty, a function is added tooptions.validationMessageswhich will useformlyUtil.formlyEvalto evaluate the message expression to get the value for the message.
- The
ngModelAttrsManipulatorpre-wrappertemplateManipulatornow adds more invoked attributes (likeng-bluretc). More can be specified withdata.ngModelInvokedAttributes. - Adding
options.modelOptionsto the list of things that will be auto-added to theng-modelelement if it exists. Woot! Whenoptions.modelOptions.getterSetteris set to true, then it will change theng-modelvalue tooptions.valuewhich is the getter setter every field gets.
- The
ngModelAttrsManipulatorused to simply bind theng-clickto thetemplateOptions.onClickwhich wouldn't actually do anything. The new invoked attributes now actually invokes the expression.
- Adding
controllerandlinkfunctions to both the field types and the field configs. You can now specify specific behaviors for components without the need to create an entire directive for it. Pretty neat huh? :-)
- Adding optional
no-ng-formattribute to theformly-form.
- Updated README and CHANGELOG
- Botched 3.0.0
- all fields will now have a the
keyvalue default to the index of the field if it isn't given a value. This makes it much easier to reference the model in templates (instead ofmodel[options.key || index]you can now simply domodel[options.key]. - adding an angular constant called
formlyVersionthat could be useful and stuff. - new feature: Template Wrappers are useful for templates that share many of the same things (like validation with ng-messages or labels). See README and tests for documentation
- new feature: formlyConfig.setType allows you to specify a type that has a
name,templateORtemplateUrl, andwrapper(s). expressionPropertiescan now accept promises! :D Thanks @djsmith42!formly-focusnew directive that allows you to easily add focus to a focusable element. This is for your templates primarily.- Any properties specified on a formly field that are not explicitly part of the api will result in an error thrown. Use
dataortemplateOptionsfor custom field values. - AWESOME new feature:
formlyConfigProvider.templateManipulators. This allows you to manipulate templates on a per-field basis prior to them being compiled. This gives you a TON of power over your templates. Game changer I'd say... :-) Currently you havepreWrapperandpostWrapperarrays to interact with, but I'm thinking of removing wrappers altogether in favor of this more powerful and more simple api. ngModelAttrsnew field config option. Allows you to dynamically add attributes to theng-modelelement of a field's template. UsesformlyConfigProvider.templateManipulators.preWrapper- Adding the ability to specify default options for field types and adding the concept of a default option-only field type. Adding
optionsTypesto the field config options for this.
- now throwing errors throughout the api to validate it is being used appropriately.
- removing
setTemplateandsetTemplateUrlin favor of the newsetTypeapi. expressionPropertieshas been simplified and improved. No longer can you specify adataobject. Instead you specify an expression that the result of the expression will be assigned to (uses the$parseservice).
- Adding links to all errors and warnings. Should hopefully help people resolve issues faster.
- If you're using angular 1.3.0 and have the ability to use the
validatorspipeline, now allvalidatorsthat are functions (rather than string expressions) run through the$asyncValidatorspipeline because there is negligible performance implications and it simplifies the validators api because you no longer need to specify isAsync on the function.
- Adding class
formly-fieldto the fields to make it easier to select them with css selectors. - Adding optional
formto what is passed to the formly-field. This gives the developer some flexibility to how they do field validation by not forcing them to rely on the mokey-patching that angular-formly does to each field. formly-custom-validationsupports the new$validatorsapi if available (in angular 1.3), otherwise it falls back to$parsers.formly-custom-validationsupports$asyncValidatorsby addingisAsync = trueproperty to the validation function.formly-formnow passesformly-fieldall of the fields.formlyConfigProvidernow allows you to disable console warnings viadisableWarningsboolean (defaults tofalse).watchercan now accept an array ofwatcherobjects.watcherobjects can now havedeepandtypeto have more control over the watch that is createdwatcherlistners and expressions now take a new last argument which is the deregistration functionexpressionPropertiesintroduced to give more control over property values for fields. It adds arunExpressionsfunction to each field which is run on every result update and can be run with the result.validatorstring expressions now run with$scope.$evaland a locals object.- field definition now has a
modelOptionsfor use inng-model-options formly-fieldnow adds avaluegetter/setter to scope for use in ng-model in combination withng-model-optionsas well as general helper functionality.formly-formnow will default to the field'smodelproperty and fallback to themodelspecified to theformly-formdirective. This allows you to specify a different model for a specific field.
- Changing API to validators.
- Changing the id given to fields. It now also contains the key also. We don't expect anyone was depending on this, but it does change behavior so it's listed as a breaking change.
- Changing from
formtong-formto allow for nesting forms as recommended. - Changing warning to throwing an error when more than one template option is provided (type, template, or templateUrl). You should never be allowed to do this in the first place.
hideExpressionandrequiredExpressionhave been removed in favor ofexpressionPropertiesformly-fieldnow expectsoptionsto be a bound property (=) rather than an expression (&)watchchanged towatcherbecause Firefox defineswatchon all objects, so determining whether the field had a watch on it was problematic.- Changing from attribute
nametoformon theformly-formdirective as this makes more sense. - Removing
optionsattribute fromformly-form. There is no good reason to specify an ID for a form (and certainly no good reason to depend on it), so it is now generated on a counter. The ID was the only attribute left on options, so nowoptionsis no longer needed. - Renaming
formFieldtoformControlas this is a more widely used term (specifically bootstrap uses this term). - Using the field's ID for the
ngModelname rather than simplyoptions.keyto ensure there are no collisions and improve consistency. Also adding logic to automatically add theformControlto the field'soptionsallowing for ease of displaying error messaging and styling and allowing us to remove the$broadcastfrom the dynamic name directive (woot). formly-formnow usesformly-fieldas an attribute instead of an element with a div. I don't expect this to be a real issue, but it may mess with your css if you're being too specific about things or referencing formly-field as an element.formly-formandformly-fieldchanged the nameresulttomodel. This makes things more clear becauseresultsounds more like after something has happend, and model sounds more like the thing that is being represented in real-time in the form. Hopefully this improved terminology will alleviate common confusion about how to preload the form and what themodel's relationship is to thefields
- Upgraded devDependencies to use angular 1.3 so the demo can show off
$asyncValidators. formly-field:formlyIdandindexare now optional properties
- Fixed bug with initializing select template.
- Added the ability to do validation on fields with
formly-dynamic-name. - Added
formly-custom-validationdirective. - Added warning in
formly-fieldwhen more than just a type, template, or templateUrl are provided (should only have one)
- Moved all demo-only related files to a demo folder and added a symbolic link to src and bower_components so when it's deployed the src and bower_components go with it. This will also allow us to make a symlink in the test directory when it's created.
- Separated out the src folder into three sub folders:
common,bootstrap, andvanilla. The build takesbootstrapandvanillaand builds them separately. They each build withcommon. There is also a separate file for setting up the default template mapping with their types and this is excluded for theno-templatesbuild. The final output is:formly.js,formly.bootstrap.js, andformly.vanilla.js. Adding other styles will be very easy. It also should make it possible for us to have directive templates (funcationality for a field). - Updated the demo to use a built version of formly because templates were such a pain. The Gruntfile has been updated to rebuild bootstrap every time something changes when
grunt watchis running. - Moved the
formly-formtemplate into a file again and added transclusion.
- Moved all field templates to separate repositories.
- Added no-template build that builds to
formly.jsand changed vanilla build toformly.vanilla.js. - Removed all options to customize the submit button and now transclude instead. Because there are multiple skins of formly it made little sense to have a template for formly that needed different styling based on the build target (bootstrap vs. vanilla). The
formly-formdirective now transcludes so a submit button can be added there. - Removed
formlyOptionsProviderbecause all useful global customizability is now unecessary. - Renamed
formlyTemplateProvidertoformlyConfigProviderto make it more generic for any future customization needs. The api is the same as before. - Added
setTemplateandgetTemplateto theformlyConfigProviderallowing developers to set template strings rather than simply a url. - Removed
defaultproperty. Interact with theformDatato set the form data. - Removed
valuefrom scope on templates. To access the value, you must now useresult[option.key || $index].
- The password field no longer uses whitespace trimming.
- Added option to override whitespace trim setting for the password field.
- Revised support for setting the
defaultforselectfields. - Added notes on contributing.
- Fixed #55 Error: field.watch.listener is undefined.
- Added support for
descriptionto all form fields. - Now providing the
resultto each field template authors have the power to associate other values of the result set with the template. - Adding
requiredExpressionto field options and assinging the field'srequiredproperty based on its evaluation. Works very much likehideExpression. - Added option to use
ng-ifinstead ofng-hideto hide fields.
Botched a publish with npm, so 0.0.13 became 0.0.14, just needed to update the changelog.
Added support for both vanilla and bootstrap templates, I hope that this opens the Formly up for even more default template options for other libraries, ie Ionic or Foundation.
Moved Bootstrap bower dependency to devDependencies.
Anyone using the old library and needing bootstrap styles will need to switch to the new bootstrap js.
Adding the formlyOptionsProvider which allows developers to set default form options.
Adding submitButtonTemplate to the configurable formlyOptions. If it has a value, then the button in the formly-form directive will be replaced with the compiled (on the scope) version of that value. Also adding twitter classes to the submit button so hopefully this template will be unecessary in some cases.
Adding the watch property which has both expression and listener properties. Formly will set a watcher on its own scope. If the watch.expression is a function, it will be wrapped and the first argument to that expression function will be the field, the rest will be the normal watch expression definition. The same is true for listener.
Adding the formlyTemplateProvider which allows developers to set templateUrls for types. Also allows them to make custom types.
Added hide property on fields. Allows devs to conditionally show fields. Also adding hideExpression property which is an expression that will be evaluated on the result object (using $parse) to make the api simpler to use.
Added template property on fields. Allows devs to have one-liner templates. Mainly used for directives so a single template can be used with options. Also improved the id of fields that use templateUrls or templates.