我尝试在页面中插入以下代码:
<md-datepicker ng-model="ctrl.myDate" md-placeholder="Enter date"></md-datepicker>
myDate在控制器中正确显示,但它不会出现在该字段的页面中:
更新:
<form ng-submit="save()" class="form" role="form">
<div class="col-md-2" id="dateContainer">
<div class="form-group">
<label for="dataCreazione">Data creazione</label>
<md-datepicker ng-model="dataCreation" class="classDate" md-placeholder="Enter date">
</md-datepicker>
</div>
</div>
<button type="submit" class="btn btn-default btn-lg">Save</button>
</form>
控制器包含:
var $scope.dataCreation = new Date();
$scope.save = function() {
console.log("the date of creation = " + $scope.dataCreation);
}