1、属性
2、Html
<ion-pane>
<ion-content>
<ion-refresher pulling-text="下拉刷新" on-refresh="doRefresh()"></ion-refresher>
<ion-list>
<ion-item ng-repeat="item in items" ng-bind="item.name"></ion-item>
</ion-list>
</ion-content>
</ion-pane>
3、Controller
appCntrollers.controller('RefreshCtrl', function ($scope, $timeout, $http) {
$scope.items = [
{ "name": "HTML5" },
{ "name": "JavaScript" },
{ "name": "Css3" }
];
$scope.doRefresh = function () {
/*
$http.get('http://www.shouce.ren/try/demo_source/item.json')//注意改为自己本站的地址,不然会有跨域问题
.success(function (newItems) {
$scope.items = newItems;
})
.finally(function () {
$scope.$broadcast('scroll.refreshComplete');
});
*/
$scope.items = [
{ "name": "菜鸟教程" },
{ "name": "www.runoob.com" }
];
$scope.$broadcast('scroll.refreshComplete');
};
})