Answer the question
In order to leave comments, you need to log in
how to set default value for input in angularjs?
The problem is this - I need the default value in the input to be 1 and, accordingly, the value in the field below = 50
jsfiddle.net/dTfA2/
How can I do this?
Answer the question
In order to leave comments, you need to log in
The easiest way is to use ngInit : jsfiddle.net/andreev_artem/dTfA2/3/
But you will almost always create a controller, right? Because the value is usually initialized there: jsfiddle.net/andreev_artem/dTfA2/4/
plnkr.co/edit/u0vaDA (to see the result, click on the eye at the top right, there is a list of files on the left, see js)
For the future, advice with fiddle =) He's great, I love him too, but he inserts his own html and body tags , and therefore many things do not work =)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question