最近几个月学习了AngularJs和扩展的UI组件,并在公司小组内做了一次分享交流,感觉很有收获,在此记录下个人的学习心得。


目录:

AngularJs的UI组件ui-Bootstrap分享(一)

AngularJs的UI组件ui-Bootstrap分享(二)——Collapse

AngularJs的UI组件ui-Bootstrap分享(三)——Accordion

AngularJs的UI组件ui-Bootstrap分享(四)——Datepicker Popup

AngularJs的UI组件ui-Bootstrap分享(五)——Pager和Pagination

AngularJs的UI组件ui-Bootstrap分享(六)——Tabs

AngularJs的UI组件ui-Bootstrap分享(七)——Buttons和Dropdown

AngularJs的UI组件ui-Bootstrap分享(八)——Tooltip和Popover

AngularJs的UI组件ui-Bootstrap分享(九)——Alert

AngularJs的UI组件ui-Bootstrap分享(十)——Model

AngularJs的UI组件ui-Bootstrap分享(十一)——Typeahead

AngularJs的UI组件ui-Bootstrap分享(十二)——Rating

AngularJs的UI组件ui-Bootstrap分享(十三)——Progressbar

AngularJs的UI组件ui-Bootstrap分享(十四)——Carousel


UI-Bootstrap是AngularJs团队在Bootstrap基础上,用AngularJs实现的一组UI控件,包括Tab页,手风琴,下拉菜单,模态窗口,日期选择等等。原生的这些控件在Bootstrap里是用Jquery写的,用了UI-Bootstrap就可以抛开Jquery,以AngularJs的风格实现我们的应用了

准备工作:

1.      既然UI-Bootstrap是Angularjs和Bootstrap的合体,那么它肯定要依赖于AngularJs脚本和Bootstrap的样式,所以在页面中,一共需要引入这几个文件:

<script src="/Scripts/angular.js"></script>

<script src="/Scripts/ui-bootstrap-tpls-1.3.2.js"></script>

<link href="/Content/bootstrap.css" rel="stylesheet" />

注:

Angularjs的版本要在1.4.0以上(后面例子中使用的是1.5.5),Bootstrap的版本要在3.0以上(后面例子中使用的是3.3.6)

ui-bootstrap-tpls-1.3.2.js名字中含有”tpls”,表示这个脚本是包括了指令中所用到的模板

如果需要用到动画和滑动,需要引入Angular-animate.js和Angular-touch.js文件

如果需要用到日期,货币,数字的本地化,需要引入angular-locale_zh-cn.js文件

2.      引入正确的脚本后,在module中需要指定依赖的module,即:

angular.module('myModule', ['ui.bootstrap']);

3.      bootstrap使用的字体图标有两个文件,后缀为woff和woff2.默认情况下,IIS是不支持这两个文件类型的,因此需要添加MIME类型,如下:

 <system.webServer>
<staticContent>
<remove fileExtension=".woff"/>
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
<remove fileExtension=".woff2"/>
<mimeMap fileExtension=".woff2" mimeType="application/font-woff" />
</staticContent>
</system.webServer>

4.      在ui-bootstrap中,以属性方式使用的指令对应的值,大多数为表达式,比如is-disabled=true,is-disabled的值就可以设置为一个表达式,或者使用{{}}绑定一个$scope的变量。有少部分指令的值不能是表达式,而要设置为字符串,在后面例子中会说明。

ui-bootstrap及其依赖的文件(点击下载)

AngularJs的UI组件ui-Bootstrap分享(一)的更多相关文章

  1. Ionic4.x 中的 UI 组件(UI Components) 侧边栏ion-menu组件以及底部tabs结合 侧边栏 ion-menu

    1.侧边栏 ion-menu 组件的基本使用 1.创建项目 ionic start myApp sidemenu 2.配置项目 属性 作用 可选值 side 配置侧边栏的位置 start end me ...

  2. Ionic4.x 中的 UI 组件(UI Components) 日期组件

    1.日期组件的基本使用 官方文档:https://ionicframework.com/docs/api/datetime 模板中: <ion-datetime display-format=& ...

  3. Ionic4.x 中的 UI 组件(UI Components) Slides 轮播图组件、Searchbar 组件、 Segment 组件

    Slides 轮播图组件 Ionic4.x 中的轮播图组件是基于 swiper 插件,所以配置 slides 的属性需要在 swiper 的 api 中 找 Swiper Api:http://ida ...

  4. Ionic4.x 中的 UI 组件(UI Components)表单相关组件

    1.ion-input 单行文本框 2.ion-toggle 开关 3.ion-radio-group.ion-radio 单选按钮组 4.ion-checkbox 多选按钮组 5.ion-selec ...

  5. 挂号平台首页开发(UI组件部分)

    JQ插件模式开发UI组件 JQ插件开发方法: 1.$.extend() 扩展JQ(比较简单,功能略显不足) $.extend({ sayHello:function(){ console.log(&q ...

  6. AngularJs的UI组件ui-Bootstrap分享(十四)——Carousel

    Carousel指令是用于图片轮播的控件,引入ngTouch模块后可以在移动端使用滑动的方式使用轮播控件. <!DOCTYPE html> <html ng-app="ui ...

  7. AngularJs的UI组件ui-Bootstrap分享(十三)——Progressbar

    进度条控件有两种指令,第一种是uib-progressbar指令,表示单一颜色和进度的一个进度条.第二种是uib-bar和uib-progress指令,表示多种颜色和多个进度组合而成的一个进度条. 这 ...

  8. AngularJs的UI组件ui-Bootstrap分享(十二)——Rating

    Rating是一个用于打分或排名的控件.看一个最简单的例子: <!DOCTYPE html> <html ng-app="ui.bootstrap.demo" x ...

  9. AngularJs的UI组件ui-Bootstrap分享(十一)——Typeahead

    Typeahead指令是一个用于智能提示或自动完成的控件,就像Jquery的AutoComplete控件一样.来看一个最简单的例子: <!DOCTYPE html> <html ng ...

随机推荐

  1. python test

    #!/usr/bin/env python #-*- encoding: utf- -*- ''' def foo(name): print name, '去砍柴' foo('yangshanlei: ...

  2. python 3次登录

    #!/usr/bin/env python #-*- encoding: utf- -*- import sys import os import getpass import platform # ...

  3. Nginx中rewrite实现二级域名、三级域名、泛域名、路径的重写

    最常见的: 静态地址重定向到带参数的动态地址 rewrite "^(.*)/service/(.*)\.html$" $1/service.php?sid=$2 permanent ...

  4. Docker容器是否可以改变世界?

    Docker容器是否可以改变世界? 2016-01-15 杜亦舒 2016年了,很多大牛开始预测技术趋势,其中一个普遍的观点我也很认同: Docker会更加流行,会改变程序世界 2015年的上半年我接 ...

  5. Python学习---除法

    python有两种除法,普通除法 a/b ,不论a,b精度 得到的都是浮点数. 4/2 = 2.0    3/5 = 0.6 floor除法,a//b , 得到一个舍弃小数位的整数结果,所以结果永远是 ...

  6. 模拟微信上传图片(带预览,支持预览gif)

    一.Html <style type="text/css"> #previewDiv{width:50px;height:50px;overflow:hidden;po ...

  7. SQL表关联赋值、系统表、表数据删除

    1. 表与表的关联赋值(用于表与表之间有关联字段,数据互传) 双表关联赋值 UPDATE #B SET #B.D=#A.B from #B inner join #A on #B.C=#A.A 多表关 ...

  8. android native crash 分析

    工具: addr2line arm-linux-androideabi-addr2line -aCfe libart.so 0x63006d 当libart.so包含符号表的情况下,可以查询到他的地址 ...

  9. css划隔横线的两种方法

    css划隔横线的两种方法  方法一:用DIV,代码如下:(推荐此方法)    <div style="width:800px;height:1px;margin:0px auto;pa ...

  10. z-index深入理解

    [CSS深入理解之z-index]听课总结 (http://www.imooc.com/learn/643)   一.z-index基础知识 1.z-index的含义 z-index属性指定了元素及其 ...