问题描述:
在Angular 5中使用日期选择器时,选择的日期值显示不正确。
解决方法:
import { Component } from '@angular/core';
import { NgbDateStruct } from '@ng-bootstrap/ng-bootstrap';
selectedDate: NgbDateStruct;
onDateSelect(date: NgbDateStruct) {
this.selectedDate = date;
console.log(this.selectedDate);
}
通过以上步骤,您应该能够正确获取并显示选择的日期值。请注意,您可能需要根据您的具体需求进行一些调整和修改。