<y> What you need to do is look at http://docs.angularjs.org/api/ng.filter:date , which is the default filter available in angular.
It seems that you are transmitting additional material with a date. See the script here. (/ Date ( *) /). With the exception of the material in * everything else does not need to parse the date, and the default angular filter will not be able to parse it. Either separate these additional materials from the model, or, alternatively, you can write your own filter to break them into the input. C>
EDIT:
Take a look at http://docs.angularjs.org/api/ng.directive:ngModel.NgModelController (and the example that is defined there!). If you intend to reuse this in several places, I suggest you do it in the method described by ngModelController. Create a new directive and implement $ render and $ setViewValue on ngModel.
If you just want to do this in one place, an alternative would be to define a new model for input. Something like
$scope.dateModel = "";
and use it
<input type="text" ng-model="dateModel" ng-change="onDateChange()"/>
In your controller, you will need to do something like:
$scope.$watch("datasource.myDateProp",function(newValue){ if(newValue){ convert(newValue); } }); function convert(val){
ganaraj
source share