ngxTypeahead not open list dropdwon angular 15

32 views Asked by At

I want to create an autocomplete with ngx-typeahead, but the dropdown menu does not open when typing, the input-text appears and you can type in it, but there is no response beyond that, I use in angular 15 and I do not succses to install ngx-typeahead more than 6.2.0 version.

what it is problem? Am I missing any code?

app.module.ts:

import { NgxTypeaheadModule } from 'ngx-typeahead';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';

@NgModule({
imports: [
NgbModule,
NgxTypeaheadModule
]

test.component.html:

<input [value]="search1" ngxTypeahead [taList]="myLocalList" [taItemTpl]="myTemp"
       (taSelected)="selectedStatic($event)">
<ng-template #myTemp let-item>
       <div class="item-name">
          {{item.result.name}}
        </div>
 </ng-template>

test.component.ts:

export class TestComponent {

public myLocalList = [
"Burgers",
"Sandwiches",
"French Fries",
"Milkshakes",
"Taco",
"Biscuit",
"Cookies",
"Hot Dog",
"Pizza",
"Pancake"
] as never[];

public search1 = '';

selectedStatic(result: string) {
   this.search1 = result;
}

package.json:

{
 "name": "test",
 "version": "0.0.0",
 "scripts": {
 "ng": "ng",
 "start": "ng serve",
 "build": "ng build",
 "watch": "ng build --watch --configuration development",
 "test": "ng test"
},
"private": true,
"dependencies": {
 "@angular/animations": "^15.2.0",
 "@angular/common": "^15.2.0",
 "@angular/compiler": "^15.2.0",
 "@angular/core": "^15.2.0",
 "@angular/forms": "^15.2.0",
 "@angular/platform-browser": "^15.2.0",
 "@angular/platform-browser-dynamic": "^15.2.0",
 "@angular/router": "^15.2.0",
 "@ng-bootstrap/ng-bootstrap": "^14.0.0",
 "bootstrap": "^5.2.3",
 "ngx-bootstrap": "^6.1.0",
 "rxjs": "~7.8.0",
 "tslib": "^2.3.0",
 "zone.js": "~0.12.0"
 },
 "devDependencies": {
  "@angular-devkit/build-angular": "^15.2.9",
  "@angular/cli": "~15.2.9",
  "@angular/compiler-cli": "^15.2.0",
  "@types/jasmine": "~4.3.0",
  "jasmine-core": "~4.5.0",
  "karma": "~6.4.0",
  "karma-chrome-launcher": "~3.1.0",
  "karma-coverage": "~2.2.0",
  "karma-jasmine": "~5.1.0",
  "karma-jasmine-html-reporter": "~2.0.0",
  "ngx-typeahead": "^6.2.0",
  "typescript": "~4.9.4"
 }
}

the result:

the result

in console get error:

enter image description here

0

There are 0 answers