formly-js / angular-formly

JavaScript powered forms for AngularJS
http://docs.angular-formly.com
MIT License
2.22k stars 403 forks source link

How to Initialize the async-ui-select in my form? #743

Open savariamir opened 7 years ago

savariamir commented 7 years ago

Hi Kent I would like to thank you for awesome module. I use the module a lot in my project but I have a problem. I want to initialize the 'async-ui-select' field but I could not initialize it. How to Initialize the 'async-ui-select'? Is it possible? Is there a good way to solve it?

for example in this address : http://angular-formly.com/#/example/integrations/ui-select if I want to set a value (like 'California, USA') to async-ui-select, what should i do it?

usmandap commented 7 years ago

If you mean initialize for preselected value in your select option then may be your model will going to work for it. Set your model value to any value in your controller and it will preselect the option. I haven't tried but it should work.

savariamir commented 7 years ago

Thank you for your answer I Know that how the form is initialized and your solution just works for non asynchronous like 'ui-select'. when we use a async-ui-select we don't have any option in client side. if you see 'async-ui-select' in this address: http://angular-formly.com/#/example/integrations/ui-select and how it works you would understand better my problem