有人可以指导我使用 formControlName 在 Angular 8 中实现日期管道吗
train.component.html
<mat-grid-tile colspan=1 rowspan=1>
<div class="train-control">
<input type="text" formControlName="{{ 'apprTimestamp' | date:'medium' }}">
</div>
</mat-grid-tile>
但似乎没有工作。有人可以指导我。
例外
TrainComponent.html:58 ERROR Error: InvalidPipeArgument: 'Unable to convert "apprTimestamp" into a date' for pipe 'DatePipe'
at invalidPipeArgumentError (common.js:5737)
at DatePipe.transform (common.js:6877)
at checkAndUpdatePureExpressionInline (core.js:34381)
at checkAndUpdateNodeInline (core.js:35155)
at checkAndUpdateNode (core.js:35090)
at debugCheckAndUpdateNode (core.js:36112)
at debugCheckDirectivesFn (core.js:36055)
at Object.eval [as updateDirectives] (TrainComponent.html:60)
at Object.debugUpdateDirectives [as updateDirectives] (core.js:36043)
at checkAndUpdateView (core.js:35055)
谢谢 !