You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having a problem with two specific properties of the sui-select component. These being, labelField and optionsFilter. I'm trying to use labelField to display the name property of my Category object, but when the dropdown menu shows the options they appear like this: [object Object]. And then I'm trying to use the optionsFilter to update the possible options by calling my back-end endpoints and filtering the results based on the query. Neither of these work for me and I'm just wandering if I'm not using them correctly and simply didn't understand the documentation. Anyway I would really appreciate some help with this, I'll try to post as much information as I can below.
I'm using the sui-select component as follows:
<form[formGroup]="createCategoryForm"><divclass="form-group"><labelclass="col-md-2 control-label">{{'models.category.category'| translate}}</label><divclass="col-md-8"><sui-selectformControlName="category"[options]="categories"[optionsFilter]="categoryFilter"[labelField]="name"[isSearchable]=true
#select><sui-select-option*ngFor="let option of select.filteredOptions"[value]="option"></sui-select-option></sui-select></div></div></form
Bug description
I'm having a problem with two specific properties of the
sui-select
component. These being,labelField
andoptionsFilter
. I'm trying to uselabelField
to display thename
property of myCategory
object, but when the dropdown menu shows the options they appear like this:[object Object]
. And then I'm trying to use theoptionsFilter
to update the possible options by calling my back-end endpoints and filtering the results based on the query. Neither of these work for me and I'm just wandering if I'm not using them correctly and simply didn't understand the documentation. Anyway I would really appreciate some help with this, I'll try to post as much information as I can below.I'm using the
sui-select
component as follows:Options filter functions:
The categories are an array in my component that's initialized in the
ngOnInit
method:I'm using reactive forms like so:
Also here's the category model:
Versions
Angular: 5.0.5
ng2-semantic-ui: 0.9.7
The text was updated successfully, but these errors were encountered: