2017-04-24 106 views

回答

0

In the docs on <md-datepicker>,存在通過使用md-current-view屬性一年選擇器的選項,將其設置爲任何yearmonth

<md-datepicker 
    md-current-view="year" 
    ng-model="myCustomYearDate" 
    md-placeholder="Enter Date"> 
</md-datepicker> 
+0

我試過,但我不力得到什麼我期待....我只需要幾年http://plnkr.co/edit/Eey5nlIiTYtiXSHZ6Luf?p=preview –

+0

@SaEChowdary看起來像'md-current-view'只在版本1.1.0和更高版本中出現。更新你的angularjs材料到1.1.0及以上 – Edric

+0

@SaEChowdary [更新的演示](http://plnkr.co/edit/nIYdfC7D9cg3o5uF6kBu?p=preview) – Edric

相關問題