Answer the question
In order to leave comments, you need to log in
Why is input value from ng-model not saved to another input?
I select a date in the datetime input, it is not selected in the format in which I need it, so I hang ng-model on the datetime input, and from there I take the value and format it into another input using value, but nothing appears in the second input.
If I do the same, but instead of the second input I put, for example, span, then the value is displayed as it should.
<div>
<input type="datetime-local" name="input" ng-model="example"/>
<input type="text" ng-model="exDate" value='{{example | date: "yyyy-MM-ddTHH:mm:ss"}}'/>
<button ng-click="add()">Добавить</button>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question