twitter-bootstrap – 如何在Angular 2项目中使用Bootstrap css
发布时间:2020-12-18 00:00:51 所属栏目:安全 来源:网络整理
导读:我开始我的第一个Angular 2应用程序,我的基本设置完成。我想知道如何添加引导css库到我的angular 2项目?谁能指导我在这里?如果你能提供一个例子,那将是一个很大的帮助。 谢谢 解决方法 与Angular2的集成也可以通过ng2-bootstrap项目: https://github.co
我开始我的第一个Angular 2应用程序,我的基本设置完成。我想知道如何添加引导css库到我的angular 2项目?谁能指导我在这里?如果你能提供一个例子,那将是一个很大的帮助。
谢谢 解决方法
与Angular2的集成也可以通过ng2-bootstrap项目:
https://github.com/valor-software/ng2-bootstrap。
要安装它,只需将这些文件放在主HTML页面中: <script src="https://cdnjs.cloudflare.com/ajax/libs/ng2-bootstrap/x.x.x/ng2-bootstrap.min.js"></script> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"> 然后你可以使用它到你的组件中这样: import {Component} from 'angular2/core'; import {Alert} from 'ng2-bootstrap/ng2-bootstrap'; @Component({ selector: 'my-app',directives: [Alert],template: `<alert type="info">ng2-bootstrap hello world!</alert>` }) export class AppComponent { } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |