![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
angular
iteye_7121
这个作者很懒,什么都没留下…
展开
-
$location 获取url的相关方法
以 'http://localhost/$location/21.1%20$location.html#/foo?name=bunny#myhash' 这个路径为例:1. 获取当前完整的url路径:$location.absUrl():// http://localhost/$location/21.1%20$location.html#/foo?name=bunny#myhash...原创 2016-05-11 10:58:52 · 574 阅读 · 0 评论 -
angular ng-class 的三种用法
1.$scope变量绑定controller代码 $scope.test ="classname"; html代码<div class="{{test}}"></div>提示:这种方法这么用是没有问题的。但是严格来说,他是不可以这么用的,有点诡异。2.字符串数组形式 controller代码 $scope.isActiv...原创 2016-06-17 16:23:56 · 1152 阅读 · 0 评论 -
ng-model 在 ng-if 里面无效
ng-if指令的功能与ng-show指令相似,都用于控制元素的显示与隐藏,但两者又有区别,ng-if指令会移除DOM原有的元素,而ng-show指令只是将元素的”display”属性值设置为”none”。因此,在使用时必须根据实际的需要进行选择性使用。 ng-if指令会创建一个子级作用域,因此,如果在ng-if指令中添加了元素,并向元素属性增加ng-model指令,那么ng-mod...原创 2016-06-20 14:52:48 · 220 阅读 · 0 评论 -
angular ui-router页面之间传递参数
有时候我们需要把一个页面的参数传到另一个页面,供另一个页面使用。下面讲个例子:有两个页面:page1.html和page2.html,点击page1.html跳转到page2.html,并将page1.html的参数传到page2.html。1.定义路由信息,并在接收的页面(即page2.html)定义接收参数。 $stateProvider.state('page1', ...原创 2016-06-22 14:25:29 · 181 阅读 · 0 评论