mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
26 lines
770 B
JavaScript
26 lines
770 B
JavaScript
angular.module('ionicApp', ['ionic'])
|
|
|
|
.controller('MyCtrl', function($scope, $timeout) {
|
|
$scope.myTitle = 'Template';
|
|
|
|
$scope.items = ['Item 1', 'Item 2', 'Item 3'];
|
|
|
|
|
|
$scope.doRefresh = function() {
|
|
|
|
console.log('Refreshing!');
|
|
$timeout( function() {
|
|
|
|
$scope.items.push('New Item ' + Math.floor(Math.random() * 1000) + 4);
|
|
$scope.items.push('New Item ' + Math.floor(Math.random() * 1000) + 4);
|
|
$scope.items.push('New Item ' + Math.floor(Math.random() * 1000) + 4);
|
|
$scope.items.push('New Item ' + Math.floor(Math.random() * 1000) + 4);
|
|
|
|
//Stop the ion-refresher from spinning
|
|
$scope.$broadcast('scroll.refreshComplete');
|
|
|
|
}, 1000);
|
|
|
|
};
|
|
|
|
}); |