Questions tagged [angular-ngselect]
Angular 5+ ng-select - Lightweight all in one UI Select, Multiselect and Autocomplete
319
questions
0
votes
1
answer
16
views
How to restore previous value of ng-select when confirmation return false?
I have a branch selection dropdown list on the page. When the dropdown is selected something, I show a confirmation message that returns 'ok' and 'cancel'. When the message returns 'Cancel' i.e 'false'...
0
votes
0
answers
22
views
How to get Search String from ng Select Angular 13
I'm trying to get server data with a real-time data search with ng select.
Is there any way to get the search string from the ng select search string?
0
votes
0
answers
11
views
Angular Ng-select: Need to select one option on selection of another option. Value pushed to selected array based on cond but checkbox is not checked
Html -
<ng-select #selecter class="custom" [items]="allDisplays" [multiple]="true" (change)="onDisplayChange()" [closeOnSelect]="false" placeholder=...
0
votes
1
answer
34
views
How to assign <ng-select [multiple]=isMultiple varibale dynamically?
I need to change a select box behavior dynamically. The below approach is not working, because this variable we cannot set dynamically after calling a service. The component will initialize before the ...
0
votes
1
answer
72
views
Display selected value from drop down list in Angular 13
Here's my code:
<tbody *ngFor="let user of users">
<td>{{user.name}}:</td>
<td>
<ng-select [items]="userList" bindValue="id" ...
0
votes
2
answers
81
views
Angular 10+ | ng-select what is the default value of appendTo
I'm using the same component on top of a modal and on a regular page.
<ng-select
[items]="obs$ | async"
[appendTo]="body"
>
</ng-select>
This works for the regular ...
0
votes
0
answers
14
views
get all the data from ng-select's observable items
I am planning to add select all for the ngSelect where my ng-select is similar to this
<ng-select formControlName="filterValue" [items]="filterValues | async"
[typeahead]=&...
1
vote
0
answers
36
views
Is there custom loader template for ng-select [closed]
I m trying to add custom loader template for ng-select drop down.
able to implement Custom loading spinner using 'ng-loadingspinner-tmp' directive
reference
custom loader is always coming in the ...
0
votes
0
answers
36
views
ng-select stop displaying invalid value
I have a ng-select component with list of options sent to as items. But ngModal value is not in the items i.e. invalid. But ng-select component still displays the invalid value. The behavior is not ...
0
votes
0
answers
170
views
Infinity scroll in ng-select - problem with load from server
I'm using ng-select in my project and I should load items for this select from server.
I have also pagination, so I should load more items when scroll is close to the end of dropdown.
And that's the ...
0
votes
1
answer
111
views
ng-select Add Tag not working when resolved inside an observable
I need to implement a case where a tag is only added when user approves it in a seperate modal i.e when user clicks on addTag, a modal is going to open which will ask the user if he wants to proceed. ...
0
votes
1
answer
447
views
@ng-select/ng-select No mouse click event on option click
I'm trying to add a filter to a filters popup built in bootstrap modal (ngx-bootstrap), but I face the following issue:
My options array looks like
[
{
"name":"All",
...
0
votes
1
answer
366
views
ng-select items not visible
I added ng-select to a new Angular 11 application, and it seems to be working fine until I open the dropdown. When I open the dropdown, I can select items but I don't really see them. There's 3 errors ...
2
votes
2
answers
481
views
Hide option list if list is empty in ng-select
I need to hide the option list of ng-select if the list is empty. Now if I click on the select box, or the searched result is empty, then option list with this No items found values is displaying. I ...
0
votes
0
answers
41
views
populate ng-select with json data
I'm trying to populate a ng-select here i leave the repo link of the package, i'm using angular 12 cli.
When i create a new register, this populate correctly and print in the form the options and the ...
0
votes
0
answers
225
views
Use custom template for ng-option & *ngFor with ng-select library
In the README of the ng-select library, you can read that there are two ways of providing selectable options.
I would like to proceed with the first option, which is using ng-option elements & and ...
0
votes
0
answers
289
views
how to programatically set an attribute value in angular ng-select
Im pretty new to Angular and Ive inherited an angular (11) app to work on.
Im having a problem with ng-select when the "multiple" attribute is set. If multiple items are selected, the ...
0
votes
1
answer
54
views
Can we provide conditionally 'bindValue' in ng-select?
<ng-select
[items]="selectdata"
bindLabel="name"
bindValue="bindValue?bindValue:''"
[multiple]="selectMultiple"
[placeholder]="placeholder"
[(...
0
votes
3
answers
154
views
Install Angular NgSelect module
I was following this tutorial to install Ngselect module in an Angular app and got this error while serving app. I googled and couldn't find what is wrong here.
ERROR in Unexpected value '...
0
votes
0
answers
245
views
Angular Ng-Select only selects one option when two of the same are given
I am relatively new to angular. I am currently working on my first project and got to know ng-select. Great modification but now I have a problem:
I have an array of objects as options from which are ...
0
votes
1
answer
69
views
using Rating in ng select angular
I tried to use p-rating in ng select but when I want to click on Rating the ng select is clicked if I want to just click on Rating but ng select is clicked My problem is that I want to click Rating ...
0
votes
3
answers
1k
views
Angular(11.2.14) ng-select2 error during ng-serve
facing this error while trying ng-serve in a freshly cloned repo works fine in my previous device (new device , coworker suspect M1 apple silicon is what caused this error)
full error log https://...
0
votes
2
answers
276
views
How to reset ng-select upon selecting another ng-select dropdown in angular?
I have 3 ng-selects like below in code, how can I reset other selections upon selecting any one. Like if i select selectOne, then selectTwo and selectThree should be reset. I'm using ng-select library....
0
votes
0
answers
25
views
Set NGSelect component (third party) value programatically
I am using NGSelect component for dropdown purpose https://www.npmjs.com/package/@ng-select/ng-select.
<ng-select
class="custom"
[items]="items"
...
0
votes
2
answers
593
views
Upgrade to Angular 10 throws errors related to @ng-select/ng-select (Incompatible peer dependencies)
I have problems when updating Angular app from version 9 to version 10.
You can see in the picture that there is an incompatible dependency. I know there are many questions asked around this but I ...
3
votes
3
answers
514
views
show database fetched values if present else show default text in ng-select angular
I have 3 dropdowns for country,state,city in angular. I have used ng-select module for those dowpdowns from reference here. On country change states populates, and on state change city populate.
...
0
votes
0
answers
32
views
Applying regex pattern on each individual item in ng-select with [multiple]="true"
I'm using ng-select with [multiple] = "true" for multiple select input field. Basically, I have an IP Address input field like below
<ng-container *ngIf="detail.type === 'ip'"&...
0
votes
1
answer
77
views
Hide and show dynamic place holder in ng-select angular when user enters text
I am trying to show placeholder in ng select control, but user type something, the placeholder does not hide. I overcame that issue with below code.
@Input() placeholder;
ngOnInit() {
this....
0
votes
0
answers
430
views
ng-select with labelForId and id
It seems like if labelForId is used in a ng-Select (https://github.com/ng-select) which also has an ID it does not work, i.e. click on label does not jump into the element.
If I do not put an ID in ...
0
votes
1
answer
846
views
how to set a default value in a ng-select inside a reactive form
Hello I'm trying to use a ng-select inside my angular reactive Form, I have just done it works but I couldn't set a default value (sample Male) in the ng-select, how can I do this?
HTML
<form [...
0
votes
0
answers
94
views
ng-select typeahead=true multiple=true pill remove script side is not working
I used ng-select in my project.
It's worked perfectly.
But I have the empty label at removing the pill time. Like below
Step to replicate:
Click the below stackblitz link
Search & select two or ...
0
votes
0
answers
161
views
Ngbdropdown comes across with ng-select then ngb autoClose="outside" not working
I'm using ng-select inside ngbdropdown. Everything works fine but in one case causing an issue.
When I click on ng-select clear icon it closes the parent ngb bootstrap dropdown.
The same issue occur ...
2
votes
3
answers
152
views
Angular - Select dropdown list is blank
In my Angular-12, I have this JSON response from the API endpoint:
{
"message": "vehicle Model Detail.",
"error": false,
"code": 200,
"results"...
0
votes
0
answers
130
views
Reposition ng-dropdown-panel manually
I have an ng-select which has a custom footer visible only on a button click. I want to reposition the ng-dropdown panel when the footer is visible. Currently, the bottom part gets hidden when the ...
0
votes
1
answer
37
views
ng-select - Data not loading correctly according to JSON
I am trying to load drop-down data using the below function. (using ng-select library)
loadBranches() {
this.registrationService.getBranchName().subscribe(data => {
console.log(data);
...
0
votes
1
answer
889
views
How to display a template in ng-select all the time?
In Angular @ng-select, How can we always show a template even if no option is selected?
If an option is selected, I can use ng-multi-label-tmp.
If No option is selected, ng-multi-label-tmp is not ...
0
votes
3
answers
463
views
Angular ng-select ngModel changes but ng-select not updating
I have an ng-select looking like this:
<ng-select
class="minimal"
[items]="productGroupTags"
[(ngModel)]="selectedProductGroup">
<...
0
votes
0
answers
147
views
Ng-select multiselect checkbox disable groups
I have to create a multiselect dropdown with two seperate groups. If item from one of the groups is selected the other group has to be disabled. Right now in ng-select we can do that but with ng-...
1
vote
1
answer
348
views
Extra white space in dropdown with VirtualScroll true in ng-select angular component
Extra space is showing in ng-select dropdown when I use virtuallScroll property as true.
Reproducible example
https://stackblitz.com/edit/angular-uuvic8?file=styles.css
1
vote
1
answer
636
views
How can I perform a backend search with ng-select using a `?q=...` HTTP parameter?
I'm using ng-select 7.2.0 in an Angular 12 app.
The data that I need to make available to ng-select consists in tens of thousands of entries, so I don't want to pre-load all that data into ng-select ...
0
votes
1
answer
76
views
How do I show extra option on checked checkbox?
I've got dropdown:
<ng-select [items]="items" bindLabel="name" ngModel name="dropdown" formControlName="dropdown" required></ng-select>
Here are ...
3
votes
1
answer
763
views
search or filter data based on first letter match
I am using ng-select library for implementing a search dropdown. I am trying to implement a custom function that will filter items by first matching letter in the dropdown when I start typing. For ...
0
votes
1
answer
274
views
ng-select - when dropdown is opened it is scrolled far-down by default
I am using ng-select for dropdown list (multiselect).
ng-select has native problem so when all items are auto-selected on dropdown init, it will be auto-scrolled far-down to last item.
It is working ...
0
votes
1
answer
60
views
All inputs and dropdown should be blocked (no possibility to write or select options) until you press the Edit button. Why is it not working?
My html file:
<div class="main-wrapper" fxLayout="row" fxLayoutAlign="center center">
<mat-card class="box">
<mat-card-header>
<...
0
votes
1
answer
332
views
ng0100 expressionchangedafterithasbeencheckederror with ng-select (@ng-select/ng-select)
I had said error for a dropdown-menu in a form. I stumbled upon the following question on stack: See discussion over ng0100 and angular lifecycle, and tried to solve it different lifecycle-...
1
vote
2
answers
231
views
Removing item from *ngFor is not reflecting in ng-select dropdown
I am using ng-select library from https://www.npmjs.com/package/@ng-select/ng-select.
Initially I have created dropdown with some values.
<ng-select
[items]="cities"
...
1
vote
0
answers
118
views
why adding extra button tag in ng-select2 drop down list
I'm trying to add button a in ng-Select2 dropdown.
I need to add html in their templateResult property with definition as how your list would show.
If I add a <span> or <div> it is working ...
0
votes
0
answers
350
views
how to display multiple columns using ng-select2 in angular 10?
I am using ng-select2 in angular 10. It's working great but it's showing a single column in the dropdown however I need to display data as a table structure in dropdown using ng-select2. I have ...
1
vote
2
answers
874
views
Remove values selected in ng-select from outside
I have used ng-select to select multiple values from a list. As per requirement, the selected values should be shown below the ng-select component, and it must be possible to remove the filter from ...
0
votes
0
answers
105
views
How to implement drag and drop in Angular ng-select
How do I implement drag and drop functionality in ng-select. I have gone through many StackOverflow answers but none of them worked for me. I have also written code for this functionality from a ...