S
S
srnsdlmtn2016-08-29 11:36:21
JavaScript
srnsdlmtn, 2016-08-29 11:36:21

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>

How to fix?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nicholas, 2016-08-29
@healqq

Use parsers/formatters for this.
link to doc

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question