{"_id":"56d91c5607ae190b00004474","__v":0,"user":"54e3723b8ef7552300409bf4","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"},"project":"5515ba4981faf83900d2b10c","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":["556314fc22ce3921003a8dd8","55675d25f15ecb23004bc8cf","55f84587e000ca0d00b280ca"],"next":{"pages":[],"description":""},"createdAt":"2015-04-10T17:49:41.158Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":11,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Production\"\n}\n[/block]\nExample: http://angular-formly.com/#/example/other/production-tips\n\n# api-check\n\nThe apiCheck.js library [recommends](https://github.com/kentcdodds/apiCheck.js#disable-apicheck) that you disable it in production. To squeeze out the most of performance, you'll want to do this ASAP in your app (before even angular-formly is loaded). Depending on how you manage dependencies, you'll simply need to get hold of the `apiCheck` factory and disable it. Something like this should do the trick:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var apiCheck = require('api-check');\\napiCheck.globalConfig.disabled = true;\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\nDoing this will maintain all the APIs (so nothing breaks that depends on apiCheck) but they will all ultimately result in a no-op.\n\n# disableWarnings\n\nangular-formly has a few places that it gives warnings to you in the console. You probably don't want these in production.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"angular.module('yourModule').config(\\n  function(formlyConfigProvider, formlyApiCheck, onProd) {\\n    formlyConfigProvider.disableWarnings = onProd;\\n  }\\n);\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"General\"\n}\n[/block]\nTake a look at the section about `extras` in the [formlyConfig](doc:formlyconfig). There are a few extras you may want to consider turning on. One that you will likely really want to turn on is the `removeChromeAutoComplete` (see [this](https://code.google.com/p/chromium/issues/detail?id=468153#c14) for more info). Another is `explicitAsync` which is only present during the deprecation period of `validators` that can return a promise. See [#369](https://github.com/formly-js/angular-formly/issues/369) for more info.\n\nHere's an example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"angular.module('yourModule').config(function(formlyConfigProvider) {\\n  formlyConfigProvider.extras.removeChromeAutoComplete = true;\\n  formlyConfigProvider.extras.explicitAsync = true;\\n});\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Blog Articles\"\n}\n[/block]\nThere have been several blog articles about angular-formly. If you write one, please hit the \"edit\" button at the top of this page and add yours!\n\n- [Easy AngularJS Forms with angular-formly](https://scotch.io/tutorials/easy-angularjs-forms-with-angular-formly)\n- [Ionic Framework Custom Formly Template using DatePicker Plugin](http://www.clearlyinnovative.com/ionic-framework-custom-formly-template-using-datepicker-plugin)\n- [Refactor your Formly forms into a Formly service](https://medium.com/:::at:::timsvoice/refactor-your-formly-forms-into-a-formly-service-3656db339a34)","excerpt":"Some things you should probably do...","slug":"tips","type":"basic","title":"Tips"}

Tips

Some things you should probably do...

[block:api-header] { "type": "basic", "title": "Production" } [/block] Example: http://angular-formly.com/#/example/other/production-tips # api-check The apiCheck.js library [recommends](https://github.com/kentcdodds/apiCheck.js#disable-apicheck) that you disable it in production. To squeeze out the most of performance, you'll want to do this ASAP in your app (before even angular-formly is loaded). Depending on how you manage dependencies, you'll simply need to get hold of the `apiCheck` factory and disable it. Something like this should do the trick: [block:code] { "codes": [ { "code": "var apiCheck = require('api-check');\napiCheck.globalConfig.disabled = true;", "language": "javascript" } ] } [/block] Doing this will maintain all the APIs (so nothing breaks that depends on apiCheck) but they will all ultimately result in a no-op. # disableWarnings angular-formly has a few places that it gives warnings to you in the console. You probably don't want these in production. [block:code] { "codes": [ { "code": "angular.module('yourModule').config(\n function(formlyConfigProvider, formlyApiCheck, onProd) {\n formlyConfigProvider.disableWarnings = onProd;\n }\n);", "language": "javascript" } ] } [/block] [block:api-header] { "type": "basic", "title": "General" } [/block] Take a look at the section about `extras` in the [formlyConfig](doc:formlyconfig). There are a few extras you may want to consider turning on. One that you will likely really want to turn on is the `removeChromeAutoComplete` (see [this](https://code.google.com/p/chromium/issues/detail?id=468153#c14) for more info). Another is `explicitAsync` which is only present during the deprecation period of `validators` that can return a promise. See [#369](https://github.com/formly-js/angular-formly/issues/369) for more info. Here's an example: [block:code] { "codes": [ { "code": "angular.module('yourModule').config(function(formlyConfigProvider) {\n formlyConfigProvider.extras.removeChromeAutoComplete = true;\n formlyConfigProvider.extras.explicitAsync = true;\n});", "language": "javascript" } ] } [/block] [block:api-header] { "type": "basic", "title": "Blog Articles" } [/block] There have been several blog articles about angular-formly. If you write one, please hit the "edit" button at the top of this page and add yours! - [Easy AngularJS Forms with angular-formly](https://scotch.io/tutorials/easy-angularjs-forms-with-angular-formly) - [Ionic Framework Custom Formly Template using DatePicker Plugin](http://www.clearlyinnovative.com/ionic-framework-custom-formly-template-using-datepicker-plugin) - [Refactor your Formly forms into a Formly service](https://medium.com/@timsvoice/refactor-your-formly-forms-into-a-formly-service-3656db339a34)