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'
}
})
}])
}]);
angular --- s3core移动端项目的更多相关文章
- angular --- s3core移动端项目(三)
angular.module('myApp') .directive('listActive',functon(){ return { restrict:'A', scope:{ listActive ...
- angular --- s3core移动端项目(二)
product-ctrl.js angular.modules('myApp').controller('ProductCtrl',['$scope','$rootScope','$timeout', ...
- 【angularjs】使用ionic+angular 搭建移动端项目,字体适配
解析: 首先,rem是以html为基准. 一般的,各大主流浏览器的font-size默认值为16px,此时1rem=16px.如果此时将rem与px进行换算很麻烦,比如0.75rem=12px. 为了 ...
- 【angularjs】使用angular搭建PC端项目,开关按钮
方法一(使用指令) 1.指令(angular-ui-switch.js) angular.module('uiSwitch', []) app.directive('switch', function ...
- 曾经的pc端项目踩到的一些兼容性的坑及其解决方案
曾经公司pc端项目一直最低兼容到IE7,要求和chrome下浏览效果一致,真心坑坏了我和另外一个小伙伴(另一个小伙伴以前也没处理过兼容问题).不过还好,在这里真心感谢鑫哥博客的详解,从底层原理讲到了具 ...
- 采用apicloud开发移动端项目心得体会
作为第一批吃螃蟹的,来说一说apicloud做移动端项目的一些体会. 刚开始接到项目,需要移动端开发两个项目,公司人员里面没有一个会原生android或者ios开发的,目前能出的技术也就是web,后端 ...
- Vue移动端项目总结
使用Vue项目写了一个移动端项目,然后又把项目硬生生的抽离了组件,一直忙着写RN项目没有时间总结心得,今天上午终于下定决心,写点总结. 1.position:absolute: 定位的时候不同手机的浏 ...
- 如何实现从Java入门到服务端项目开发的进阶?
对于打算入门或者刚刚入门学习Java的人来说,刚开始接触这门学科,往往会觉得不知所措,也会觉得很迷茫.结合前人经验,就从入门到进阶对于Java的学习而言,应该对于学习时间.目标和内容规划有一个清晰的定 ...
- 从零开始搭建vue移动端项目到上线的步骤
初始化项目 1.在安装了node.js的前提下,使用以下命令 npm install --g vue-cli 2.在将要构建项目的目录下 vue init webpack myproject(项目目录 ...
随机推荐
- 如何使用onclick方式添加多个事件回调函数
通过给onclcik包裹一个函数进行上下文的切换与参数的传递: function addClcikEvent(el, fn){ if(el.onclick){ var _back = el.oncli ...
- 个人小爱好:Operating System: three easy pieces第6章第5节——总结
总结 我们讨论了实现CPU虚拟化的部分底层机制,及我们统称为直接执行(direct execution)的一组技术.基本的思想十分简单明了:直接在CPU上运行你想运行的代码,但是你先得确保将硬件设置好 ...
- Gym 101194E / UVALive 7901 - Ice Cream Tower - [数学+long double][2016 EC-Final Problem E]
题目链接: http://codeforces.com/gym/101194/attachments https://icpcarchive.ecs.baylor.edu/index.php?opti ...
- java学习笔记-集合set
equals指内容(值)相等,== 指地址相等 ===============set类 set继承自collection,但set没有新增方法,只是set里的元素不重复,下面是set常用方法 ==== ...
- JDBC事务(三)ThreadLocal绑定Connection
处理一个请求即开启一个线程,在三层中,执行三层中的方法都是用的同一个线程. 我们开启一个事务,使用conn.setAutoCommit(false); conn应该属于ado层,不应该出现在servi ...
- 基于UVM的verilog验证
Abstract 本文介绍UVM框架,并以crc7为例进行UVM的验证,最后指出常见的UVM验证开发有哪些坑,以及怎么避免. Introduction 本例使用环境:ModelSim 10.2c,UV ...
- [转贴] 软件测试职业发展的 A 面和 B 面
[转贴] 软件测试职业发展的 A 面和 B 面 1.所谓的软件测试技术到底包含什么? 梅子:我先来从传统意义上来谈一下测试技术,主要就是测试分析,测试设计,测试管理,测试执行,自动化测试技术,专项测试 ...
- docker+elasticsearch的安装
查询镜像 [root@ elasticsearch]# docker search elasticsearch INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMA ...
- [OpenCV]直线拟合
OpenCV实现了直线的拟合. CV_IMPL void cvFitLine( const CvArr* array, int dist, double param, double reps, dou ...
- Golang--不定参数类型
1.不定参数类型 不定参数是指函数传入的参数个数为不定数量. package main import ( "fmt" ) //不定参数函数 func Add(a int, args ...