zoukankan      html  css  js  c++  java
  • angular --- s3core移动端项目

    因为记性不好的原因做个草稿笔记

    app.js中

    var myApp = angular.module('myApp',['ui.router','oc.lazyLoad','ngAnimate','数据处理','公共js方法']);

      注册权限访问服务

      myApp.factory('$permissions',['$rootScope','$es',function($rootScope,$es){

        //...

      }]);

      

      myApp.run(['$rootScope','$state','$stateParams','$permissions','$es','缓存公共函数$istore','$modal','$timeout',

          function($rootScope,$state,$stateParams,$permissions,$es,$istore,$modal,$timeout){

          //...处理配置信息到模块

          //进行微信浏览器判断

          var isMicroMessenger r= function(){

            var ua = navigator.userAgent.toLowerCase();

            if (ua.match(/MicroMessenger/i) == 'micromessenger') {  

                               return true;  

                         } else {  

                               return false;  

                         } 

          }

          $rootScope.iswx = isMicroMessenger ();

          //切换主题

          var skinString == 'skinBlueskinRedskinGreenskinOrange";

          var skinPath = config.basic.theme || "skinBlue"

          if(skinString.indexOf(skinPath) == -1)  skinPath = 'skinBlue';

          angular.element('#cssfile').attr('href','style/'+skinPath+'.css')

      }]).config(['$stateProvider','$urlRouterProvider',function($stateProvider,$urlRouterProvider){

        //版本控制

        function getVersion(){

          var date = new Date();

          var v = date.getTime();

          return "?v="+v;

        }

        var version = getVersion();

        //路由

        $urlRouterProvider.otherwise('/app');

        $stateProvider.state('app',{

          url:'/app',

          templateUrl:'view/public/app.html'+version,

          resolve:{

            service:'UserInfoService',

            ctrl:['$ocLazyLoad',function($ocLayload){

              return $ocLazyLoad({

                files:[

                  'scripts/home-ctrl.js'+version

                ]

              })

            }

          }

        })

        //产品模块举例

        .state('products',{

          url:'/products',

          template:'<div ng-class="transition"></div>',

          //abstract 抽象模板抽象模板不能被激活,但是它的子模板可以被激活      

          abstract:true,

          resolve:{

            service1:'ProductService',

            service2:['$ocLazyLoad',function($ocLayload){

              return $ocLazyLoad({

                files:[

                  'scripts/product-ctrl.js'+version,

                  'view/css/product.css'+version

                ]

              })

            }

          }

        })

        

        .state('products.productList',{

          url:'/productList',

          templateUrl:'view/product/productList.html'+version,   

          title:'产品列表',

          controller:'ProductCtrl'

          }

        })

        

      }]) 

      }]);

  • 相关阅读:
    Ubuntu 8.04安设nVidia新版表现驱动
    特性化设置你的linux环境
    Ubuntu 8.04 去失踪文泉驿的点阵字形的方法
    Fedora Nightlife项目 扶助较劲争论机的空闲
    Ubuntu显卡驱动不精确,进入黑屏的处置装备
    Linux中翻开带flash网页主动封锁的处理办法
    Firefox 3 Alpha 5
    Ubuntu 8.04无法正常关机成就处置惩罚
    Redhat Enterprise Linux 5.2 公布了
    KOffice 1.6.3
  • 原文地址:https://www.cnblogs.com/peiyao/p/7264212.html
Copyright © 2011-2022 走看看