我想使用firebase中的日期作为反应形式来更新或更改值
网站是我来自Firebase的数据
ngOnInit() {
this.siteForm = this.formBuilder.group({
id: [this.site.id],
title: [this.site.title, Validators.required],
link: [this.site.link, Validators.required],
linkAdmin: [this.site.linkAdmin, Validators.required],
refSite: [this.site.refSite, Validators.required],
screen: [this.site.screen, Validators.required],
dev: [this.site.dev, Validators.required],
created: [this.site.created, Validators.required]
});
}
<div class="form-group row">
<label for="created" class="col-md-3 col-form-label">Date de création :</label>
<div class="col-md-9">
<input (blur)="OnCheck()" (change)="onSubmit()" type="date" class="form-control" id="created" name="created"
formControlName="created" required placeholder="Changer la date de création"
[ngClass]="{ 'is-invalid': (check || submitted) && f.created.errors }">
<div *ngIf="(check || submitted) && f.created.errors" class="invalid-feedback">
<div *ngIf="f.created.errors.required">Date is required</div>
</div>
</div>
</div>
我尝试在模板中使用管道或在脚本中进行转换,但是没有任何效果。如果有人有想法?非常感谢。