1.安装插件

https://github.com/apache/cordova-plugin-inappbrowser

执行命令:
cordova plugin add org.apache.cordova.inappbrowser

采用命令查看:
cordova plugin ls

2.简单代码

$scope.godetail=function(unit){
var options = {
location: 'yes',
clearcache: 'yes',
toolbar: 'no'
};
var reg=/^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/;
if(reg.test(unit.DetailAddr)){
$cordovaInAppBrowser.open(unit.DetailAddr, '_blank', options)
.then(function(event) {
// success
})
.catch(function(event) {
// error
});
//$cordovaInAppBrowser.close();
}
else{
$ionicLoading.show({
noBackdrop: true,
template: "地址错误",
duration: 1500
});
}
}
$rootScope.$on('$cordovaInAppBrowser:loadstart', function(e, event){
alert("I安装中了");
});
  <div class="card">
<div class="item">
<strong>{{HelpProc.RescueModel.UnitName}}&nbsp;<label class="price">¥{{HelpProc.RescueModel.Amount}}</label></strong>
<div class="item" ng-repeat="unit in HelpProc.RescueModel.ListRescue" ng-click="godetail(unit)">
<span > {{unit.UnitName}}</span>
<div class="clearfix"></div>
<p class="align_right "><label class="labgreen">¥{{unit.Amount}} &nbsp;{{unit.DtTime}}</label></p>
</div>
</div>
</div>

3.效果图

 

备注:这个是ngcordova 的写法,cordova 写法参考其它

参考地址:

http://www.ionic-china.com/doc/ngCordova/In%20App%20Browser.html

http://cordova.apache.org/docs/en/3.3.0/cordova/inappbrowser/inappbrowser.html

 

最新文章

  1. win7默认网关不可用怎么解决
  2. 转:Git 求生手册 - 第三章分支工作
  3. A trip through the Graphics Pipeline 2011_12 Tessellation
  4. 枚举 POJ 1753 Flip Game
  5. hadoop mapred-queue-acls 配置(转)
  6. 【分享】SQL Server优化50法
  7. 转: css3: display:box详解
  8. apk反汇编之smali语法
  9. sql server 2008 数据库管理系统使用SQL语句创建登录用户详细步骤
  10. 纯css实现select下拉框并排显示
  11. FaaS技术框架
  12. Codeforces Round 504
  13. Tomcat服务安全加固
  14. 安卓中使用OkHttp发送数据请求的两种方式(同、异步的GET、POST) 示例-- Android基础
  15. eclipse打开出现Failed to create the java virtual machine
  16. cygwin简介及使用
  17. 保存登录plsql developer 的用户名和密码
  18. 【git】 linux 环境安装git
  19. spring boot 静态变量注入配置文件
  20. Unix 网络编程 读书笔记3

热门文章

  1. SpringBatch批处理框架
  2. Windows del
  3. 大数据之hadoop集群安全模式
  4. python支付宝页面扫码支付
  5. [VS2008] Debug版本程序发布后 由于应用程序的配置不正确,应用程序未能启动,重新安装应用程序可能会纠正这个问题
  6. STM32之glossary
  7. 20.multi_case05
  8. Python接口测试框架实战与自动化进阶✍✍✍
  9. 使用virtualenv发布Python程序
  10. 1.关于Python的发展历史你知道吗?