I try to achieve this:
<input name="formkey"
ng-model="formkey"
value="1_4bKU-Be3K4sMuoQTDHfz7uMqGd9N9fU6bGd1EjEu8s"
>
or:
<input type="hidden"
name="formkey"
ng-model="formkey"
value="1_4bKU-Be3K4sMuoQTDHfz7uMqGd9N9fU6bGd1EjEu8s"
>
The input is empty when I look at it in a browser. If I remove ng-model="formkey"
it works, so I assume the empty formkey-value overwrites my value.
I know I can add values to the scope with javascript. But I use this same javascript in a lot of different views, so I would much prefer to add the value in my view somehow. Is it at all possible?
ng-init
should do the trick:
<input ng-init="formkey='Your default value'" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With