angularjs的cache
摘要:首先要引入angular-cookies.js插件 写一个服务,方便调用,加入服务cache 使用:
阅读全文
posted @
2018-08-17 17:32
chenlw101
阅读(635)
推荐(0)
angularjs路由传递参数
摘要:ui-sref、$state.go 的区别 ui-sref 一般使用在 <a>...</a>; $state.go('someState')一般使用在 controller里面; 2 如何传递参数 首先,要在目标页面定义接受的参数: 传参, $state.go: 接收参数,(加上$state) 获取
阅读全文
posted @
2018-08-17 17:28
chenlw101
阅读(299)
推荐(0)
angularjs路由相关知识
摘要:angular.module('app').config(['$stateProvider','$urlRouterProvider',function($stateProvider,$urlRouterProvider){ //$stateProvider路由模块,配置状态,可以放入多个.state //state(路由id,{路径,路由的url,业务逻辑}) $stateProv...
阅读全文
posted @
2018-08-16 10:31
chenlw101
阅读(102)
推荐(0)
angularjs指令实现轮播图----swiper
摘要:调用:<swipers-lbt data="lbts"></swipers-lbt> lbts:
阅读全文
posted @
2018-08-15 13:50
chenlw101
阅读(191)
推荐(0)
angularjs中阻止事件冒泡,以及指令的注意点
摘要:指令里面,<div new-Str class="new"></div> 指令newStr,在外面用的时候要new-Str这样用
阅读全文
posted @
2018-08-03 10:17
chenlw101
阅读(1028)
推荐(0)
Angularjs给动态生成的元素绑定事件
摘要://获取动态生成的元素 getJqforAnguar:function(jqid){ angular.element(document).injector().invoke(function($compile){// 编译html var $jqid = jqid; ...
阅读全文
posted @
2018-07-25 10:48
chenlw101
阅读(267)
推荐(0)
angularjs指令中的scope
摘要:共享 scope 使用共享 scope 的时候,可以直接从父 scope 中共享属性。因此下面示例可以将那么属性的值输出出来。使用的是父 scope 中定义的值。 js代码: html代码 输出结果: 隔离 scope 使用隔离 scope 的时候,无法从父 scope 中共享属性。因此下面示例无法
阅读全文
posted @
2018-06-29 16:25
chenlw101
阅读(214)
推荐(1)
angularjs的路由ui.router
摘要:路径可以是{ '/home':只匹配'/home' '/user/id'、'user/{id}':匹配 '/user/123'或者'/user/' }
阅读全文
posted @
2018-06-26 15:51
chenlw101
阅读(119)
推荐(0)
angularjs中ng-repeat插入图片
摘要:<tr ng-repeat="item in datas" ng-module="datas"> <td> <img class ="img" ng-src="{{item.picurl}}"> </td> </tr> 可以使用ng-src来repeat图片
阅读全文
posted @
2018-06-19 10:28
chenlw101
阅读(256)
推荐(0)