asicfr asicfr - 1 year ago 110
AngularJS Question

How to bind View Date to model milliseconds with Angularjs

I want to bind an input of type Date on the view

to a milliseconds property in the model with Angularjs.

For example :

the user set "09/23/2014" into the field

and angularjs automatically set "1411423200000"

into the model property binding with the input.

I don't find any directive or filter to do that.

Thanks for your help.

UPDATE to detail my question.

Is there a "native" way in Angularjs to intercept

model to view AND view to model and convert my data ?

Answer Source

I found a solution with :


With that, i change dynamically the data format during the binding.

See full solution in jsfiddle

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download