I have an input of type date, and I need that it is not possible to select a date that is not from today, I tried it this way, but I was not very successful:
HTML:
<input [(ngModel)]="atv.dataini" type="date" class="form-control" #one min="{{this.today}}">
TYPESCRIPT:
today = this.dNow.getFullYear() + '-0' + (this.dNow.getMonth() + 1) + '-0' + this.dNow.getDate();
I also tried it this way:
HTML:
<input [(ngModel)]="atv.dataini" type="date" class="form-control" #one min="{{this.tdNow}}">
TYPESCRIPT:
dNow = this.formatDate(new Date());
formatDate(date) {
let result = date.split('-').reverse().join('/');
return result
}