Guides
GuidesExamplesGitterLog In

formly-field

directive

❗️

Misses features outside of formly-form

Most things you specify as options to configure a field are used by this directive, however, some properties about the field (like watchers for example) will simply be ignored. Most of the time you should use the formly-form directive instead.

Attributes

Attribute NameScope TypeDescription
options= binding (required)The field config. Must have a type OR template OR templateUrl. Everything else is optional, but it is limited to specific properties. Any extra options will result in an error (because angular-formly loves you).
model= binding (required)The model for the field to represent. Most fields will use ng-model="model[options.key]"
form= binding (optional)The NgFormController that will be used to get and set the formControl for the field.
formId= binding (optional)The id of the form, used to generate the id for the field which is used in the name (for the formControl) and the id of the field (useful for a label's for attribute)
index= binding (optional)The index of the field, used if key is not defined on the field.
fields= binding (optional)The other fields. As convenience if needed.
formState= binding (optional)The formly-form.options.formState property. This is how fields can communicate with one another without polluting the model.