2

我正在尝试实现一个拉动刷新角度组件。我对 Angular 很陌生,但 Chrome 开发人员工具不会显示任何错误。

有关更多信息,请参阅:https ://github.com/mgcrea/angular-pull-to-refresh/blob/master/readme.md

<!DOCTYPE html>
<html ng-app="myApp">

<head>
    <style>
        body { background:blue; }
        * {
            /*-webkit-user-select: none; */
            /*-webkit-touch-callout: none; */
        }

    </style>

    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js"></script>
    <link rel="stylesheet" href="pull-to-refresh.css">
    <script src="pull-to-refresh.js"></script>


    <script>

        var app = angular.module('myApp', ['mgcrea.pullToRefresh']);

        angular.module('myApp')

            .controller('NetworkCtrl', function($scope) {

            $scope.refresh = function() {
                alert('refresh!');
            };

        });

    </script>

</head>
<body ng-controller="NetworkCtrl">

    <div class="content" pull-to-refresh="refresh()" style="background:yellow">
        test<br>
        test<br>
        test<br>
        test<br>
        test<br>
    </div>

</body>
</html>
4

0 回答 0