this.isOpenedCheck = setInterval(this.selectClose, 100);
Copy the code
selectClose(): void {
if (this.auto.isOpen){ return; }
if ( this.isOpenedCheck) { clearInterval(this.isOpenedCheck); }
if(!this.formControl.value){
this.formControl.setValue(this.placeholder);
}
else if (!this.options.some( option= > option === this.formControl.value )){
this.formControl.setValue(this.placeholder || ' ');
}
this.input.nativeElement.blur();
}
Copy the code
This changes the pointer to point to window
Solutions:
import * as _ from 'lodash';
Copy the code
ngOnInit(): void {
_.bindAll(this.'selectClose');// Bind an object's methods to the object itself, overwriting existing methods.
}
Copy the code
The results of