0

I'm a little new to Angular and there's a project I'm playing around with that uses bootstrap and for all the dynamic components, it uses ngx-bootstrap.

When I want to import a component from ngx-bootstrap (ex. carousel) I just use/import the component.

ex.

import { OtherModeules, CarouselModule } from 'ngx-bootstrap';

Question - if I wanted to use another carousel component from mdbootstrap will I have to download and use the entire library, just to use the carousel, or can I get just that component? Or say a component from Angular Material design?

Concern - Afraid of downloading lots of libraries for different components resulting in a large project file and much bigger files to download by the users.

chuckd
  • 13,460
  • 29
  • 152
  • 331
  • with newer versions of Angular (5+) only the js that is relevant and used is added at compile time. So if you use mdbootstrap but import and use only one module, the build will contain only the relevant module - not the whole mdbootstrap library.... relevant post on SO: https://stackoverflow.com/questions/52496276 – Akber Iqbal Jun 25 '19 at 11:41

1 Answers1

0

In case of ngx-bootstrap, you can use direct import, like:

import { CarouselModule } from 'ngx-bootstrap/carousel';
LudmilaN
  • 124
  • 1
  • 3