Topic: Is there a callback when selecting an item in mdb-completer dr

beachjf pro asked 7 years ago


Hi, I would like to know if there is any method I could call when I select an item in the suggested list. A kind of onSelectedItemFromList property.
<mdb-completer [label]="'Search'" name="autocomplete" placeholder="search" [(ngModel)]="tag" [datasource]="tagList"

[minSearchLength]="2" #item

[onSelectedItemFromList="onAddTag(item.value)"></mdb-completer>
Thanks a lot

Maciej Szuchta free answered 7 years ago


Hello beachjf You can use (selected) EventEmitter  of completer component like this:  
<mdb-completer [label]="'Search'" name="autocomplete" placeholder="search" [(ngModel)]="tag" [datasource]="tagList"

[minSearchLength]="2" #item

(selected) = "onAddTag($event)"></mdb-completer>


$event passed to onAddTag function should contain information about selected value.   Best Regards Maciej

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

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags