autocomplete

diego pennisi pro asked 6 years ago

I do not work autocomplete for angular, I copied only the sample model     CompleterComponent.html:1 ERROR TypeError: Object(...) is not a function at MdbInputCompleteDirective.onBlur (ng-uikit-pro-standard.es5.js:2678) at Object.eval [as handleEvent] (CompleterComponent.html:1) at handleEvent (core.js:13589) at callWithDebugContext (core.js:15098) at Object.debugHandleEvent [as handleEvent] (core.js:14685) at dispatchEvent (core.js:10004) at eval (core.js:10629) at HTMLInputElement.eval (platform-browser.js:2628) at ZoneDelegate.invokeTask (zone.js:421) at Object.onInvokeTask (core.js:4751)

Arkadiusz Idzikowski staff answered 6 years ago

Dear diego, For me everything works fine. I need to see html and ts code you are using in order to help you. Please make sure you copied example code to your typescript file as well and changed import paths for CompleterData and CompleterService. Best, Arek

diego pennisi pro commented 6 years ago

Dear Arek , this is the code html: <div> <div><mdb-completer [label]="'Seleccionar colores'"initialValue="Select color"name="autocomplete" [(ngModel)]="searchStr" [datasource]="dataService" [minSearchLength]="0"></div> <div></mdb-completer></div> </div> --- this is the code ts import { CompleterData, CompleterService } from 'ng-uikit-pro-standard'; private searchStr: string; private dataService: CompleterData; private searchData = [ { color: 'red'}, { color: 'green'}, { color: 'blue'}, { color: 'cyan'}, { color: 'magenta'}, { color: 'azul'}, { color: 'negro'}, ]; constructor(private completerService: CompleterService) { this.dataService = completerService.local(this.searchData, 'color', 'color'); console.log(this.searchData); } thank... for you comment

Arkadiusz Idzikowski staff answered 6 years ago

Dear diego, There are too many div tags in your HTML code. If you need div wrapper for your mdb-completer component it should look like this:
<div>
<div>
<mdb-completer [label]="'Seleccionar colores'" initialValue="Select color" name="autocomplete" [(ngModel)]="searchStr"
[datasource]="dataService" [minSearchLength]="0">
</mdb-completer>
</div>
</div>
Best, Arek

diego pennisi pro commented 6 years ago

does not work yet and now I change the label to <mdb-autocomplete [label]="'Select color'" initialValue="Select color" name="autocomplete" [(ngModel)]="searchStr" [datasource]="dataService" [minSearchLength]="0"> </mdb-autocomplete>

Arkadiusz Idzikowski staff commented 6 years ago

Dear diego, Could you please describe in details what problems do you have with this component now? There are some problems with autocomplete when using both label and initialValue that we need to fix. Best, Arek

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No