角度形で未定義日のリターン:私はAPIに</p> <p>component.htmlそれを通過したい私は、私の形式で日付フィールドを持つ4
<form [formGroup]="addMeetingForm" (ngSubmit)="onSubmit(t)" #t="ngForm">
<div class="row">
<!-- first Row data -->
<div class="form-group" class="col-lg-5 ">
<ul class="flex-outer">
<!-- first Element -->
<li>
<label for="date">
<i class="fa fa-calendar fa-lg"></i>
date
<span style="color: red"> * </span>
</label>
<input type="date" formControlName="date" [(ngModel)]="date" >
</li>
component.ts:
ngOnInit(){
console.log(this.date);
this.addMeetingForm= new FormGroup({
'date' : new FormControl(null, Validators.required),
を
日付は常に未定義です。私はカレンダーの日付形式を選択してから、それをapiに渡します
dataStorage.s ervice.ts:
storeMeeting(meeting){
let url = 'http://api.azharcouncil.com/api/MainCouncils/PostMainCouncil?place='+meeting.place+'&number='+meeting.number+'&type='+meeting.kind
+'&date='+meeting.date+'&time='+meeting.time+'&description='+meeting.description+'&file='+meeting.file+'¬es'+meeting.notes+'&user_Id='+15;
let headers = new Headers({ 'Content-Type': 'text/plain' });
let options = new RequestOptions({ headers: headers });
return this.http.post(url, JSON.stringify(meeting), options);
}
[(ngModel)] =「日付」はどうしてですか? – Wandrille
私は日付を渡すためにそれを使用しようとしました –