博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
angular-cli创建angular2项目并添加ng2-bootstrap
阅读量:7087 次
发布时间:2019-06-28

本文共 490 字,大约阅读时间需要 1 分钟。

1、首先全局安装angular-cli,并创建项目

npm install -g angular-cling new my-appcd my-app

2、安装ng2-bootstrap和bootstrap

npm install ng2-bootstrap bootstrap --save

3、在主模块中导入,需要的模块(src/app/app.module.ts)

import { AlertModule } from 'ng2-bootstrap';...@NgModule({   ...   imports: [AlertModule.forRoot(), ... ],    ... })

只要在模块总导入,不需要在组建中添加,很方便。

4、在angular-cli.json中配置样式文件

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

5、 在模板中调用 src/app/app.component.html

hello

转载地址:http://wfwql.baihongyu.com/

你可能感兴趣的文章
实验二
查看>>
Android开发,在Activity启动时,默认隐藏软键盘。和遮挡Edittext时的处理
查看>>
Mongodb shell 基本操作
查看>>
【转】oracle connect by用法
查看>>
android Animation 动画绘制逻辑
查看>>
Ubuntu 12.04安装和设置SSH服务
查看>>
[转]重入和不可重入函数概念浅析
查看>>
git学习心得总结
查看>>
实验四 主存空间的分配和回收
查看>>
scala mysql jdbc oper
查看>>
浅谈分支预测、流水线与条件转移(转载)
查看>>
前端技能树
查看>>
【软件工程】02组软件工程组队项目——课程管理小助手需求文档
查看>>
java面试每日一题8
查看>>
leetcode Majority Element
查看>>
UISprite(NGUI)扩展 图片镂空
查看>>
只是一段听力练习:金凯瑞致伊斯特伍德
查看>>
求第五个人多大岁数
查看>>
mybatis什么时候用resulttype 什么时候用resultmap
查看>>
去除sql的前后半角全角空格
查看>>