在angular 9中使用datepicker时出现错误。我的目标是阻止今天的日期之前的所有日期
我的component.ts
import { Component, OnInit, ViewChild } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { ToastrService } from 'ngx-toastr';
import { Cookie } from 'ng2-cookies/ng2-cookies';
import { HttpService } from './../../http.service';
import * as $ from 'jquery';
@Component({
selector: 'app-activebug',
templateUrl: './activebug.component.html',
styleUrls: ['./activebug.component.css']
})
export class ActivebugComponent implements OnInit {
constructor(){}
ngOnInit(): void {
$(document).ready(function () {
$("#datepicker").datepicker({
minDate: 0
});
})
}
}
我的HTML档案
<input type="date" id="datepicker" value="2020-02-18" min="2020-02-18" max="2020-12-31">