材料设计中的Datapicker

时间:2015-10-01 10:29:29

标签: angularjs

亲爱的同事们,祝你生日快乐。我的页面上有MaterialDesign中的dataPicker。在我的页面中,我想看到dataPicker的一部分,就像这样的日历。有谁知道如何实现它?

我想看到这个:

enter image description here

而不是:

enter image description here

1 个答案:

答案 0 :(得分:0)

这是一个带有内联日期选择器的bootstrap和angularjs的演示:

http://plnkr.co/edit/7pnPeudbgTY3hd2SNATA?p=preview

重要的部分是包含在html中:

  • 与ui-bootstrap-tpls相关的脚本,在演示中称为angular-ui-bootstrap.js

  • 注入你的模块,这个bootstrap - in demo由angular.module('plunker', ['ui.bootstrap']);

  • 完成
  • 包含bootstrap css

  • 在html中添加

   <div style="display:inline-block; min-height:290px;">
      <datepicker ng-model="dt" min-date="minDate" show-weeks="true" class="well well-sm"></datepicker>
  </div>
  • 并在控制器初始化dt模型:$scope.dt = new Date();
相关问题