我有一个angular2-cli项目。我使用bootstrap 3作为ui。
现在我需要支持rtl。
我在这个链接中看到,我可以通过npm添加bootstrap-rtl。它是否也与angular-2 cli项目匹配?
发布于 2017-12-15 05:17:33
您必须先安装angular-2的ng-bootstrap
npm install ngx-bootstrap bootstrap --save然后,您必须在ngModule中添加ng-bootstrap:
import { AlertModule } from 'ngx-bootstrap';
...
@NgModule({
...
imports: [AlertModule.forRoot(), ... ],
...
})然后,您必须从npm安装rtl-bootstrap:
npm install bootstrap-rtl最后,您必须打开angular-cli.json并在样式数组中插入一个新条目:
"styles": [
"styles.css",
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
"../node_modules/bootstrap-rtl/dist/css/bootstrap-rtl.min.css",
...
]发布于 2017-03-28 16:56:42
将此标准补丁用于Bootstrap 3或Bootstrap 4
https://stackoverflow.com/questions/41611199
复制相似问题