Prefill a form in ionic


#1

Hi when i usually want a form to be prefilled i use for example
But this doesnt work with ionic. How do i prefill a text field form with ionic?

Thanks
Andreas


#2

Just use the html placeholder attribute if you do not want the actual value of the input to change:
<textarea type="text" ng-model="YOURMODEL" placeholder="YOURPLACEHOLDER"></textarea>

or set the value of the model in your controller on load, if you want the value to change.
You might want to take a look at the example given here:
https://docs.angularjs.org/api/ng/directive/input


#3

Thanks the link you posted helped me solve the problem

Regards Andreas