ng2-select.css is missing after installing with npm

Created on 23 Sep 2016  Â·  17Comments  Â·  Source: valor-software/ng2-select

Hi there,

The readme tells me to install the ng2-select.css but it is missing in my npm installation.... Please add it there,

Thanks,
Martin

Most helpful comment

All 17 comments

Same issue here

Same here. There is no css file.

it seems to be hard coded ... :( so hard to make my own styles.

:( you're missing the point @grauschnabel

The spirit of these comments/confirmations of a missing file are to help guide the repo towards completion, not to complain that there is no css file.

I was a bit ironic or sarcastic, sorry for that. Of course I think the css should be taken out of the components/select/select.ts file (where I think the ng2-select.css content is included) and be put to an extra css file for easy editing by anyone for his/her project.

You don't actually need the ng2-select.css because its based on bootstrap dropdowns.scss/less,
Just import bootstrap into your scss and you're fine:
@import "~bootstrap-sass/assets/stylesheets/bootstrap";

Also having this problem. The file ng2-select/components/css/ng2-select.css seems to be missing from the package.

confirmed with bootstrap 4 (adding dropdown styles solved the issue)

adding dropdown styles solved the issue

Could you elaborate what exactly you did? Thanks!

@cortopy I'd like to hear how you solved that too. Did you have to import all of Bootstrap 4 or just the dropdown styles?

@GFoley83 I only use ng2-select on Bootstrap projects. I only include what I need though. For Bootstrap 4 I'd try adding just the dropdown (and perhaps the grid?)

@cortopy Thanks for that. Tagging @dhilgarth as my answer may be relevant for you. I only wanted to use Bootstrap 3 for ng2-select, not globally in my project. I was able to get it working by importing the following in the scss file for the component I was using ng2-select in:

:host ng-select /deep/ {
    @import "~bootstrap-sass/assets/stylesheets/bootstrap";
}

I'm sure I could have just pulled in the specific stylesheets required e.g. _dropdown.scss etc. but I actually scrapped using ng2-select completely in favour of PrimeNG's autocomplete component:

http://www.primefaces.org/primeng/#/autocomplete

Thanks for the tag @GFoley83 :-)

New life the component is there: https://github.com/optimistex/ng2-select-ex

New life the component is there: https://github.com/optimistex/ng2-select-ex

Can you please explain how to set the default value in ngx-select-ex. You give an example and it is randomly choosing the value from the array. But I need to set a single value. So, please tell how to set the single default value.

@santhoshsakthivel Just provide it into the component:
image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

newerik picture newerik  Â·  5Comments

Hasnain-Bukhari picture Hasnain-Bukhari  Â·  3Comments

bissolli picture bissolli  Â·  6Comments

253936563 picture 253936563  Â·  5Comments

Kiwi15 picture Kiwi15  Â·  4Comments