![](/img/trans.png)
[英]In angular, why are my ng-shows not updating to reflect the current scope?
[英]Angular 8 ng-reflect-model shows correct date value but not reflecting in input
使用
<div class="ui-g-12 ui-md-12">
<input
id="licenseForEdit.issuedDate"
type="date"
name="licenseForEdit.issuedDate"
pInputText
placeholder="License Issued Date"
[(ngModel)]="licenseForEdit.issuedDate"
required
[class.field-error]="form.submitted && !licenseForEdit.issuedDate"
/>
</div>
我得到:
<input _ngcontent-atp-c10="" id="licenseForEdit.issuedDate" name="licenseForEdit.issuedDate" pinputtext="" placeholder="License Issued Date" required="" type="date" ng-reflect-required="" ng-reflect-name="licenseForEdit.issuedDate" ng-reflect-model="2019-01-01T00:00:00" class="ng-pristine ng-valid ng-touched">
首先請檢查格式是否正確。
在此處查找 MDN 的參考資料。
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date 。
如果出於顯示目的需要轉換該值,請使用 pipe。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.