How to set bindLabel when using pipe?
See original GitHub issueI have this in my html, needed to use ng-template because of pipe.
<ng-select [items]="codeList" [virtualScroll]="true"
[(ngModel)]="selectedCode"
bindValue="code" name="name-code" required>
<ng-template ng-option-tmp let-item="item">
<div title="item">{{item | translateCode: (infoService.getCurrentLanguage())}}</div>
</ng-template>
</ng-select>
List of options in dropdown is showing ok, but when I select some option it doesn’t shows. Of course, search is not working either.
How is possible to call function for translation of every option/item so that ng-select works okay? One way would be function in bindLabel, but for now I can see it only accepts string.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6
Top Results From Across the Web
Use pipe on bindLabel at <ng-select> - Stack Overflow
It seems like you have to use a template, try: <ng-select [items]="prozessItem$ | async" [multiple]="true" bindValue="nrItems" > ...
Read more >How to set bindLabel when using pipe? - Bountysource
How to set bindLabel when using pipe ?
Read more >Ng Select - StackBlitz
bindLabel ="name". placeholder="Select city". [(ngModel)]="selectedCity"> ... <label>Multiselect with custom. bindings</label>. <ng-select [items]="cities2".
Read more >bind label in a grid view - MSDN - Microsoft
Object reference not set to an instance of an object. can you please help me with this? Sunday, July 13, 2008 3:30 AM ......
Read more >Data sources
Backend data with async pipe ... You can also set array of objects as items input ... you may want to set simple...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found this solution:
Add two functions - searchFn and compareWith (see ng-select docs for explanation).
hope this work
using :