Reputation:
I have a date in $scope. When the page loads I want the input type="date" field value to be set on the value in $scope.
<input class="form-control" type="date"
ng-model="asso.formation_of_association"
placeholder="" />
But I only see dd-mm-yyy
on the input field
Upvotes: 0
Views: 49
Reputation: 1
check the type of the ng-model
value with typeof
if the typeof
returns a date
replace in your input file with type date
Upvotes: 0
Reputation: 116
You should show your code becouse I prepared an example and it works.
<div ng-app>
<div ng-controller="myCtrl">
<input type="date" ng-model="date.formation_of_association">
</div>
</div>
function myCtrl($scope) {
$scope.asso = {
'formation_of_association': '2018-06-21'
};
}
Upvotes: 1