我可以使用md-datepicker显示日历。
控制器: -
angular.module('plunker').controller('mycont', function(){
this.myDate = new Date();
this.isOpen = false;
});
查看: -
<body ng-controller="mycont" ng-cloak>
<section layout="row" layout-sm="column" layout-align="center center" layout-wrap></section>
<md-datepicker ng-model="ctrl.myDate" md-placeholder="Enter Date" md-open-on-focus></md-datepicker>
</body>
我可以显示日历,但我想知道所选日期的值保存在哪里,以便我可以打印所选日期
我在尝试
<body ng-controller="mycont" ng-cloak>
<section layout="row" layout-sm="column" layout-align="center center" layout-wrap></section>
<md-datepicker ng-model="ctrl.myDate" md-placeholder="Enter Date" md-open-on-focus></md-datepicker>
<p>The Date you picked is {{ctrl.myDate}}</p>
</body>
如果您想查看其余代码: - http://plnkr.co/edit/n84v9Cxug67f4ikTuyGf?p=preview