I am using Angular 7 with a JQuery datepicker : https://github.com/uxsolutions/bootstrap-datepicker
<div class="col-lg-2">
<div class="form-group">
<div class="input-group">
<input class="form-control form-control-lg" data-provide="datepicker" data-date-language="fr" type="text" data-date-format="dd/mm/yyyy" placeholder="From" [(ngModel)]="from" name="from" />
<div class="input-group-append">
<span class="input-group-text"><i class="fa fa-calendar" aria-hidden="true"></i></span>
</div>
</div>
</div>
</div>
But in the component, this value I receive in this.from
is undefined
..
export class SearchBarComponent implements OnInit {
constructor(
private router: Router
) { }
search: string;
from: string;
to: string;
ngOnInit() {
}
onSubmit() {
console.log(this.from)
}
}
I do not want to use bundle like ng-boostrap
or ngx-boostrap
because I do not want to trick with the navbar to get it working. And I prefer to control the dependencies of Boostrap.
Is there a simple way to watch for changes of this input value please ? I did not find this answer clearly in the questions that can exist.