zoukankan      html  css  js  c++  java
  • ionic webapp

    优化 图片缓存

    localstrrage

    插件

    https://github.com/paveisistemas/ionic-image-lazy-load

    https://github.com/sunsus/ngImgCache

    https://github.com/sunsus/ngImgCache/blob/master/ngImgCacheIonic.js

    ionic的页面之间的跳转, 用href="#/tab/index", href="#/shop" ,要注意那个tab

    同属于tab的页面或则其他同类型的页面之间跳转才有动画.

    service.js 里面放全局的函数和变量,并负责与服务器端通信.

    controller.js 负责把service取得的数据分配到模板里, 这里面是每个模板对应一个控制器, 函数可以写在它的控制器,如$scope.fly=function(){};

    app.js组织所有的模板, 还有每个页面的路径

        .state('tab.groupbuy', {
          url: '/groupbuy',
          views: {
            'tab-groupbuy': {
              templateUrl: 'templates/tab-groupbuy.html',
              controller: 'GroupBuyCtrl'
            }
          }
        })
        /*
        .state('citys', {
          url: "/citys",
          controller: 'CitysCtrl',
          templateUrl: "templates/citys.html"
        })
    */
        .state('shops', {
          url: "/shops/:categoryId",
          controller: 'ShopsCtrl',
          templateUrl: "templates/tab-shops.html",
          animation: 'slide-left-right-ios7'
        })
    
        /*
        .state('market', {
          url: "/market/:marketId",
          controller: 'MarketCtrl',
          templateUrl: "templates/market.html",
          animation: 'slide-left-right-ios7'
        })
    
        .state('markets', {
          url: "/markets/:markettype",
          controller: 'MarketsCtrl',
          templateUrl: "templates/markets.html",
          animation: 'slide-left-right-ios7'
        })
    */
        .state('shopdetail', {
          url: "/shopdetail/:shopId",
          controller: 'ShopdetailCtrl',
          templateUrl: "templates/tab-shop.html"
        })

     state里面的路径才是 在location.href=""里面应该用的,不过 . 要换成 /

    ionic模板里的函数是不能直接写变量的

  • 相关阅读:
    寒假了
    【MFC】浏览器中快速打开常用工具
    【转】MFC隐藏进程自身(任务管理器不可见,wSysCheck等工具可见)
    【原】DIY属于自己的鼠标侧键
    coco2dx 3.4final 使用scale9sprite
    linux挂载新硬盘
    关于c语言中的结构体使用偏移量求值问题
    Linux的网卡由eth0变成了eth1,如何修复
    oracle归档管理
    exsi上虚拟因硬盘不足无法启动
  • 原文地址:https://www.cnblogs.com/whuper/p/4205972.html
Copyright © 2011-2022 走看看