zoukankan      html  css  js  c++  java
  • ionic刷新和加载

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    <link rel="stylesheet" href="../lib/css/ionic.css">
    <script src="../lib/js/ionic.bundle.min.js"></script>

    <script>
    var myapp=angular.module('testApp', ['ionic'])
    .controller('MyController', function($scope, $http) {
    $scope.items = [{"title":"01","desc":"2016秋季爆款","imgsrc":"img/TB1_50x50.jpg"},
    {"title":"02","desc":"2016秋季爆款","imgsrc":"img/TB2_50x50.jpg"},
    {"title":"03","desc":"2016秋季爆款","imgsrc":"img/TB3_50x50.jpg"},
    {"title":"04","desc":"2016秋季爆款","imgsrc":"img/TB4_50x50.jpg"},
    {"title":"05","desc":"2016秋季爆款","imgsrc":"img/TB1_50x50.jpg"},
    {"title":"06","desc":"2016秋季爆款","imgsrc":"img/TB4_50x50.jpg"},
    {"title":"06","desc":"2016秋季爆款","imgsrc":"img/TB4_50x50.jpg"},
    {"title":"06","desc":"2016秋季爆款","imgsrc":"img/TB4_50x50.jpg"},
    {"title":"06","desc":"2016秋季爆款","imgsrc":"img/TB4_50x50.jpg"},
    {"title":"06","desc":"2016秋季爆款","imgsrc":"img/TB4_50x50.jpg"},
    {"title":"06","desc":"2016秋季爆款","imgsrc":"img/TB4_50x50.jpg"}];
    $scope.doRefresh = function() {
    $http.get('../items.json')
    .success(function(newItems) {
    $scope.items = newItems;
    })
    .finally(function() {
    // 停止广播ion-refresher
    $scope.$broadcast('scroll.refreshComplete');
    });
    };
    });
    </script>

    </head>
    <body ng-app="testApp">
    <ion-header-bar align-title="center" class="bar-positive">
    <div class="buttons">
    <button class="button" ng-click="doSomething()">左侧按钮</button>
    </div>
    <h1 class="title">Title!</h1>
    <div class="buttons">
    <button class="button">右侧按钮</button>
    </div>
    </ion-header-bar>

    <ion-content ng-controller="MyController">
    <ion-refresher
    pulling-text="下拉刷新..."
    on-refresh="doRefresh()">
    </ion-refresher>
    <ion-list>
    <ion-item ng-repeat="item in items">{{item.desc}}</ion-item>
    </ion-list>
    </ion-content>


    <ion-footer-bar align-title="center" class="bar-assertive">
    <div class="buttons">
    <button class="button">左侧按钮</button>
    </div>
    <h1 class="title">Title!</h1>
    <div class="buttons" ng-click="doSomething()">
    <button class="button">右侧按钮</button>
    </div>
    </ion-footer-bar>

    </body>
    </html>

    //重要点:导包和items.json
  • 相关阅读:
    Python——文件操作2
    Python——文件操作1
    Python——集合
    Springboot @Transactional捕获异常事务回滚
    elasticsearch5.2 高亮java代码
    Java static作用
    elasticsearch6.3 自动补齐suggest java代码
    spring boot通过官网创建新项目
    eclipse web工程不能 修改build path
    linux虚拟机添加网卡
  • 原文地址:https://www.cnblogs.com/wsq110/p/7683717.html
Copyright © 2011-2022 走看看