I have some logic that i simplified in this JSFiddle: http://jsfiddle.net/r7vyjg4h/ and that works.
html:
<div ng-controller="MyCtrl">
<div ng-repeat="line in lines">
<div style="display: inline-block">
{{line.id}}
</div>
<div style="display: inline-block">
<input type="text" ng-model="line.date" />
</div>
</div>
<input type="button" ng-click="update()" value="update" />
</div>
js:
function MyCtrl($scope) {
$scope.lines = [{
id:"1",
date: new Date()
},{
id:"2",
date: new Date()
},{
id:"3",
date: new Date()
}
];
var newDates = [{id:"1", date: new Date('10-10-2010 10:10:10')}, {id:"3", date: new Date('11-11-2011 11:11:11')}];
$scope.update = function(){
for(var i = 0; i < newDates.length;i++){
for(var j = 0; j < $scope.lines.length; j++){
if($scope.lines[j].id == newDates[i].id){
$scope.lines[j].date = newDates[i].date;
}
}
}
}
What it does it picks some dates from a web request and are supposed to add it to the right boxes in an ng-repeat. So far it still works out correct.
But when i change the input type from text to date, nothing happens. The values i picks out is correct but the date elements does not update.
What am i missing here? Am i doing something wrong ?