我爱编程

Using Bootstrap 4 with Angular

2017-06-28  本文已影响115人  RoyTien

Way One - Using ngx-bootstrap

From: https://github.com/valor-software/ngx-bootstrap


Using with Bootstrap 4 with angular-cli

create a new project <my-app>

ng new my-app
cd my-app

Adding ngx-bootstrap and bootstrap 4

projects>my-app> npm install ngx-bootstrap bootstrap@next --save

Using with css

Configuring Project

Now that the project is set up it must be configured to include the bootstrap CSS.

"styles": [  
    "../node_modules/bootstrap/dist/css/bootstrap.min.css",  
    "styles.css"  
],

Testing

import { AlertModule } from 'ngx-bootstrap';
@NgModule({
    imports: [BsDropdownModule.forRoot(),... ],
})
<alert type="success">hello</alert>

Way Two - Using ng-bootstrap

From: https://ng-bootstrap.github.io/#/home


上一篇 下一篇

猜你喜欢

热点阅读