phoneGap,angularJs,onSen的一些备忘
1.ng-click="funcName";这里的funcName需要再控制器里的$scope.funcName=function(){}进行定义
2.ng-controller="xxCtl" 放在 <ons-page.... ng-controller="xxx">标签里
3. <script src="cordova.js"></script>
这个在chrome里调试时要注释掉,不然有一堆对话框,打包成apk时需要取消注释
这个提供了js调用android(ios)平台的插件的功能,插件配置在,res/xml/config.xml里(eclipse目录下)
4.在独立js文件(全局函数库里定义的函数)
需要写成var uploadFile=function(){};
写成function uploadFile(){}时,引用不到,另外独立的js文件引用标签<script src="xxx.js"></script>要放在使用代码的前面。
5.使用$scope.$apply()刷新页面数据
6.在控制器里使用ons.read(function(){}); 确保访问$scope.data变量可访问
module.controller("bottomCtl",function($scope,$http){
ons.ready(function(){
console.log($scope.tabbar);
});
$scope.myBtnClick=function(){
//===========
var isLoginUrl=apiUrl+"/GetLoginStatus.aspx?"+"&CALLBACK=JSON_CALLBACK";
$http.jsonp(isLoginUrl).success(function(json){
if(json.result.Code==0){
$scope.tabbar.loadPage('lxwm.html');
}else{
var user=localStorage["username"];
var pwd=localStorage["password"];
if(user!=null && pwd!=null){
//================
var url=apiUrl+"/login.aspx?username="+ user +"&password="+ pwd+"&CALLBACK=JSON_CALLBACK";
$http.jsonp(url).success(function(json){
if(json.result.Code==0){
$scope.tabbar.loadPage('lxwm.html' );
}else{
$scope.tabbar.loadPage('dengru.html');
}
});
//==============
}else{
$scope.tabbar.loadPage('dengru.html');
}
}
});
//======End======
return false;
}
});
7.其他
phoneGap,angularJs,onSen的一些备忘的更多相关文章
- AngularJS资源合集[备忘]【申明:来源于网络】
AngularJS资源合集[备忘][申明:来源于网络] 地址:http://blog.csdn.net/allgis/article/details/44646597
- AngularJS测试框架 karma备忘
AngularJS测试框架karma安装 安装karma $ --save-dev 安装karma组件 $ npm install karma-jasmine karma-chrome-launche ...
- AngularJS之备忘与诀窍
译自:<angularjs> 备忘与诀窍 目前为止,之前的章节已经覆盖了Angular所有功能结构中的大多数,包括指令,服务,控制器,资源以及其它内容.但是我们知道有时候仅仅阅读是不够的. ...
- Angularjs ngTable使用备忘
项目中用到angularjs的表格ng-table,功能相当强大,像搜索.排序.checkbox.分页.每页表格显示数目等都有.API,demo什么的也只能参考官网了.这里做个备忘,哪天肯定还会用到. ...
- GIS部分理论知识备忘随笔
文章版权由作者李晓晖和博客园共有,若转载请于明显处标明出处:http://www.cnblogs.com/naaoveGIS/ 1.高斯克吕格投影带换算 某坐标的经度为112度,其投影的6度带和3度带 ...
- python序列,字典备忘
初识python备忘: 序列:列表,字符串,元组len(d),d[id],del d[id],data in d函数:cmp(x,y),len(seq),list(seq)根据字符串创建列表,max( ...
- Vi命令备忘
备忘 Ctrl+u:向文件首翻半屏: Ctrl+d:向文件尾翻半屏: Ctrl+f:向文件尾翻一屏: Ctrl+b:向文件首翻一屏: Esc:从编辑模式切换到命令模式: ZZ:命令模式下保存当前文件所 ...
- ExtJs4常用配置方法备忘
viewport布局常用属性 new Ext.Viewport({ layout: "border", renderTo: Ext.getBody(), defaults: { b ...
- [备忘] Automatically reset Windows Update components
这两天遇到Windows 10的更新问题,官方有一个小工具,可以用来修复Windows Update的问题,备忘如下 https://support.microsoft.com/en-us/kb/97 ...
随机推荐
- FMX ScrollBox 拖拽控制
Firemonkey下的ScrollBox 拖拽控制,滚动控制,拖拽,滚动条 AniCalculations 仅允许纵向拖拽,拖拽 scrlbx.AniCalculations.TouchTracki ...
- maven错误
maven-enforcer-plugin (goal "enforce") is ignored by m2e. Plugin execution not covered by ...
- CentOS 7 Tomcat安装
官网: http://tomcat.apache.org/download-80.cgi 下 1.载zip包 >wget http://mirrors.hust.edu.cn/apache/to ...
- 常用Sql语句,及注意事项
目录: sql语句 sql命令语句 关键字 sql语句 SELECT * FROM V$reserved_words;--查询oracle预留关键字 SELECT * FROM V$version;- ...
- ubuntu 安装搜狗输入法
from:http://blog.csdn.net/qq_21792169/article/details/53152700 最近开始学习linux 在安装输入法中遇到的一些问题,最终成功安装,也得益 ...
- 第二次安装docker时,报Transaction check error的解决方法
如果在yum安装软件的时候,出现了Transaction check error:这种情况,说明rpm软件包出现了冲突,解决方法是: vi /etc/yum.repos.d/epel.repo 将en ...
- spring 中的断言的作用
org.springframework.util.AssertAssert翻译为中文为"断言".用过JUNIT的应该都知道这个概念了.就是断定某一个实际的值就为自己预期想得到的,如 ...
- 3类与对象——重拾Java
面向对象编程的3个特性 1 封装性 面向对象编程核心思想之一就是将数据和对数据的操作封装在一起.通过抽象,即从具体的实例中抽取共同的性质形成一般的概念,比如类的概念. 在实际生活中,我们每时每刻都在与 ...
- Null Hypothesis and Alternate Hypothesis
1.Null Hypothesis Overview 零假设,H0是普遍接受的事实;这与备择假设(alternate hypothesis)正好相反.研究人员努力否定.驳斥零假设.研究人员提出了另一种 ...
- 信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:
问题信息详细: 信息: The APR based Apache Tomcat Native library which allows optimal performance in productio ...