UNPKG

ng2-bootstrap-base-modified

Version:

Native Angular Bootstrap Components Typeahead modified

77 lines (60 loc) 2.22 kB
# Documenting full steps to install and test with [angular-seed](https://github.com/mgechev/angular-seed) ```bash npm install --save ng2-bootstrap bootstrap ``` ### In **project.config.ts** ``` //uncomment this import { ExtendPackages } from './seed.config.interfaces'; // Add `NPM` third-party libraries to be injected/bundled. this.NPM_DEPENDENCIES = [ ...this.NPM_DEPENDENCIES, // {src: 'jquery/dist/jquery.min.js', inject: 'libs'}, // {src: 'lodash/lodash.min.js', inject: 'libs'}, { src: 'bootstrap/dist/js/bootstrap.min.js', inject: 'libs' }, { src: 'bootstrap/dist/css/bootstrap.min.css', inject: true }, // inject into css section { src: 'bootstrap/dist/css/bootstrap-theme.min.css', inject: true }, // inject into css section { src: 'bootstrap/dist/css/bootstrap-theme.min.css.map', inject: true }, // inject into css section ]; // *towards the bottom, replace extended packages with this: let additionalPackages: ExtendPackages[] = [ // required for dev build { name:'ng2-bootstrap', path:'node_modules/ng2-bootstrap/bundles/ng2-bootstrap.umd.min.js' }, // required for prod build { name:'ng2-bootstrap/*', path:'node_modules/ng2-bootstrap/bundles/ng2-bootstrap.umd.min.js' }, // mandatory dependency for ng2-bootstrap datepicker { name:'moment', path:'node_modules/moment', packageMeta:{ main: 'moment.js', defaultExtension: 'js' } } ]; this.addPackagesBundles(additionalPackages); ``` ## Verify by adding an alert to the home module and html: ### In **home.module.ts:** ``` import { AlertModule } from 'ng2-bootstrap/alert'; @NgModule({ imports: [CommonModule, HomeRoutingModule, SharedModule, AlertModule.forRoot()], declarations: [HomeComponent], exports: [HomeComponent], providers: [NameListService] }) ``` ### In **home.component.html:** ``` <alert type="success"> <strong>Well done!</strong> You successfully read this important alert message. </alert> ``` ### Huge thanks to [Keslavi](https://github.com/keslavi) for this doc