Extending types is one of the ways so makes angular-formly help you keep your angular forms DRY. When use responsibly, they can make it much easier to manage common types, allowing you to add a bit of functionality to a Common type.
(function() { ' Use strict '; varApp = Angular.module (' formlyexample ', [' formly ', ' formlybootstrap ']); App.run (function(formlyconfig) {formlyconfig.settype ({name:' Avengersselect ', extends:' SELECT ', Defaultoptions: {templateoptions: {label:' Favorite Avenger ', Options: [{name:' Iron man ', Value: ' Iron_man '}, {name:' Captain America ', Value: ' Captain_america '}, {name:' Black widow ', Value: ' Black_widow '}, {name:' Hulk ', Value: ' Hulk '}, {name:' Thor ', Value: ' Thor '} ] } } }); }) App.controller (' Mainctrl ',functionMainctrl ($timeout) {varVM = This; Vm.model= {}; Vm.fields=[{type:' Avengersselect ', Key:"Avengersselect"}, {type:' Avengersselect ', Key:"AvengersSelect2", Templateoptions: {label:' Favorite Avenger 2 ', Options: [{name:' Iron man ', Value: ' Iron_man '}, {name:' Captain America ', Value: ' Captain_america '}, {name:' Black widow ', Value: ' Black_widow '}, {name:' Hulk ', Value: ' Hulk '}, {name:' Thor ', Value: ' Thor '} ] } } ]; });}) ();
[AngularJS] angular-formly:extending Types