为什么我的模型的Date属性未显示在此输入字段中?

时间:2017-03-28 19:16:28

标签: angularjs

我的模型的日期类型属性(vm.reportSchedule.StartSchedule)设置为今天。

我需要在文本类型的输入字段中格式化显示日期。

我正在使用Plunker的这个指令:http://plnkr.co/edit/R16IPQ?p=preview

  

我添加了对moment.js的引用并使用了必需的HTML语法:

<input type="text" ng-model="vm.reportSchedule.StartSchedule" 
       mo-date-input="MM/DD/YYYY hh:mm A" readonly required />

由于某种原因,此字段中未显示日期。

BTW,在那个plunker中,如果你摆脱ng-repeat,它就会停止工作,我不明白为什么。

没有JS错误,日期格式字符串是正确的。

enter image description here

我从Plunker复制的指令(无需检查,我只是从Plunker示例中复制了它):

它在Plunker中运行得很好。

感谢任何帮助。感谢。

0 个答案:

没有答案