简体   繁体   中英

Angular2 Cannot find name 'UISearch'

I use external JavaScript library in Angular2. When I start server, I am receiving error in terminal.

Cannot find name 'UISearch'. [default] Checking finished with 1 errors

My code

ngAfterViewInit() {
    new UISearch( document.getElementById( 'sb-search' ) );
}

UISearch has red curve error line. I think, that I need append '< any >', but I don't know how. I hope you will help me

How did you import UISearch? If the library is imported you might want to try:

constructor(private UISearch:uisearch){}  

ngAfterViewInit() { 
this.uisearch( document.getElementById( 'sb-search' ) ); 

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM