angular实现checkbox单选和取消

template:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<form novalidate>
选择名字:{{chooseArr}}
<ion-list>
<ion-checkbox ng-model="checkItem" ng-repeat="item in checkGroup" ng-click="chooseItem(item,checkItem)">
{{item}}
</ion-checkbox>
</ion-list>
<a class="common-button"
ng-click="getCheckBox()"
ng-disabled="!checkStatus"
ng-class="{true:'btn-disable',false:'btn-enable'}[!checkStatus]"
style="margin-top:15px;">
点击
</a>
</form>

angular中filter使用和缓存jsonp数据

angular缓存jsonp数据:

参考自:https://www.chedanji.com/angularjs-cache-for-jsonp/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
angular.module('app',[])
.factory("myCache", function($cacheFactory){
return $cacheFactory("me");
})
.controller("AppCtrl", function($http, myCache){
var app = this;
app.load = function(){
$http.get("apiurl",{cache:myCache})
.success(function(data){
app.data = data;
})
}
app.clearCache = function(){
myCache.remove("apiurl");
}
})
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×