{"_id":"56d91c5607ae190b0000446e","category":{"_id":"56d91c5507ae190b00004464","__v":1,"project":"5515ba4981faf83900d2b10c","pages":["56d91c5607ae190b00004469","56d91c5607ae190b0000446a","56d91c5607ae190b0000446b","56d91c5607ae190b0000446c","56d91c5607ae190b0000446d","56d91c5607ae190b0000446e","56d91c5607ae190b0000446f","56d91c5607ae190b00004470","56d91c5607ae190b00004471","56d91c5607ae190b00004472","56d91c5607ae190b00004473","56d91c5607ae190b00004474","56d91c5607ae190b00004475","56d91c5607ae190b00004476"],"version":"56d91c5507ae190b00004460","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-03-27T20:15:06.295Z","from_sync":false,"order":0,"slug":"guides","title":"Guides"},"__v":0,"project":"5515ba4981faf83900d2b10c","user":"54e3723b8ef7552300409bf4","version":{"_id":"56d91c5507ae190b00004460","__v":1,"project":"5515ba4981faf83900d2b10c","createdAt":"2016-03-04T05:25:41.052Z","releaseDate":"2016-03-04T05:25:41.052Z","categories":["56d91c5507ae190b00004464","56d91c5507ae190b00004465","56d91c5507ae190b00004466","56d91c5507ae190b00004467","56d91c5507ae190b00004468"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"8.0.0","version":"8.0.0"},"updates":["56abf918d4432d1900eed24e"],"next":{"pages":[],"description":""},"createdAt":"2015-03-30T18:42:50.729Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":5,"body":"[egghead.io lesson](https://egghead.io/lessons/angularjs-angular-formly-custom-validation?pl=7) | [custom validators](http://angular-formly.com/#/example/advanced/validators) | [integration with is.js](http://angular-formly.com/#/example/integrations/is-js)\n\nYou can specify custom validation in your JSON. See the property called `validators` on your field config in [formly-form](doc:formly-form) for more information on this.\n\nFormly uses angular's built-in validation mechanisms. See the [angular docs](https://docs.angularjs.org/guide/forms) for more information on this. (Note, if you're using Angular 1.3, formly utilizies the new `$validators` and `$asyncValidators` pipelines, otherwise, it falls back to good old `$parsers`. Either way, your API with formly is the same, including asynchornous validation with 1.2.x!!!! <-- this is a big deal).\n\nThe form controller is bound to what you specify as the `form` attribute on the `formly-form` directive. Formly will add a `formControl` property to the field, and you can reference that in your template with `options.formControl` to get access to properties like `$invalid` or `$error`. See the bootstrap templates for an example. Note, there's also a shortcut called `fc` on the `formly-field` scope so you have access to it in your templates.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Learn the nuances of <ng-form> / <form> / <formly-form>\",\n  \"body\": \"There are some interesting things you should be aware of when dealing with the different forms with angular. See a decently in-depth explination here: http://jsbin.com/mepega/edit?html,output\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"No built-in validators\",\n  \"body\": \"Angular does some validation itself depending on an input's type, but angular-formly doesn't actually ship with any pre-defined validators. You will need to define your own.\"\n}\n[/block]","excerpt":"","slug":"validation","type":"basic","title":"Validation"}
[egghead.io lesson](https://egghead.io/lessons/angularjs-angular-formly-custom-validation?pl=7) | [custom validators](http://angular-formly.com/#/example/advanced/validators) | [integration with is.js](http://angular-formly.com/#/example/integrations/is-js) You can specify custom validation in your JSON. See the property called `validators` on your field config in [formly-form](doc:formly-form) for more information on this. Formly uses angular's built-in validation mechanisms. See the [angular docs](https://docs.angularjs.org/guide/forms) for more information on this. (Note, if you're using Angular 1.3, formly utilizies the new `$validators` and `$asyncValidators` pipelines, otherwise, it falls back to good old `$parsers`. Either way, your API with formly is the same, including asynchornous validation with 1.2.x!!!! <-- this is a big deal). The form controller is bound to what you specify as the `form` attribute on the `formly-form` directive. Formly will add a `formControl` property to the field, and you can reference that in your template with `options.formControl` to get access to properties like `$invalid` or `$error`. See the bootstrap templates for an example. Note, there's also a shortcut called `fc` on the `formly-field` scope so you have access to it in your templates. [block:callout] { "type": "warning", "title": "Learn the nuances of <ng-form> / <form> / <formly-form>", "body": "There are some interesting things you should be aware of when dealing with the different forms with angular. See a decently in-depth explination here: http://jsbin.com/mepega/edit?html,output" } [/block] [block:callout] { "type": "info", "title": "No built-in validators", "body": "Angular does some validation itself depending on an input's type, but angular-formly doesn't actually ship with any pre-defined validators. You will need to define your own." } [/block]