This is for a reply comment on:
https://www.gurustop.net/blog/2016/07/24/angular2-angularcli-load-cli-from-git-github-master-webpack
This is for a reply comment on:
https://www.gurustop.net/blog/2016/07/24/angular2-angularcli-load-cli-from-git-github-master-webpack
You can import
the different modules wherever you need them.
For example, for a component using AlertComponent
, you go to the component you want to use the alert in, and just import it:
import { AlertComponent } from 'ng2-bootstrap/ng2-bootstrap';
After that, you add it to the directives of your @Cimponent
.
directives: [AlertComponent]
Then you can just go and use it in the component HTML:
<Alert>Message</Alert>
Note that the bootstrap CSS is not included in ng2-bootstrap. You'll have to load this manually.
If you want to load this locally not from a CDN, you are in for more trouble.
Just doing
import 'bootstrap/dist/css/bootstrap.css';
will not work. There's an open issue about it.
One possible workaround is to include the CSS in AppComponent, and change the view encapsulation to None so the styles are loaded globally for that component: