ngCordova判断是否有网络以及监控摄像头网线接线图网络变

&nbsp>&nbsp
&nbsp>&nbsp
&nbsp>&nbsp
ngCordova安装与插件的使用
--相机拍摄和本地相册选择照片
摘要:一,安装ngCordovabowerinstallngCordova--save-dev二,引入ng-cordova.js文件把ng-cordova.js或ng-cordova.min.js引入到index.html中。注意顺序:要放在cordova.js之前,AngularJS/Ionic文件之后(ngCordova依赖AngularJS)三,注入ng-cordova依赖在主程序的app.js中引入ng-cordova依赖angular.module('myApp',['n
一,安装ngCordova
bower install ngCordova --save-dev二,引入ng-cordova.js文件
把ng-cordova.js或ng-cordova.min.js引入到index.html中。
注意顺序:要放在cordova.js之前,AngularJS/ Ionic文件之后(ngCordova依赖AngularJS)三,注入ng-cordova依赖
在主程序的app.js中引入ng-cordova依赖
angular.module('myApp',['ngCordova'])四,添加插件到Cordova CLI环境中
一个较好的cordova插件清单链接http://doc.wex5.com/cordova-plugins/
官网ng-cordova插件集合:http://ngcordova.com/docs/plugins/
eg.安装照相机插件
在项目的目录下,打开命令行,输入
$cordovapluginaddcordova-plugin-camera
查看已安装插件
$cordovapluginls
cordova-plugin-camera2.1.1&Camera&
五,camera插件的使用详情
1. 主js文件(app.js)中要有以下代码,这些功能是启动应用就要有。
angular.module('myApp',
'ngCordova',
'ionic-native-transitions',
'myApp.controllers',
'myApp.services',
'myApp.directives'
.run(function(
$ionicPlatform,
$rootScope,
$cordovaNetwork
$ionicPlatform.ready(function(){
if(window.cordova&;&;window.cordova.plugins&;&;window.cordova.plugins.Keyboard){
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.disableScroll(true);
if(window.StatusBar){
//org.apache.cordova.statusbarrequired
StatusBar.styleDefault();
2.在需要使用的模块中注入$cordovaCamera服务
//点击换头像的方法
$scope.action.toChangeAvatar=function(){
varhideSheet=$ionicActionSheet.show({
{text:'拍照'},
{text:'从手机相册选择'}
cancelText:'取消',
cancel:function(){
buttonClicked:function(index){
console.log(index);
if(index=='0'){
document.addEventListener(&deviceready&,function(){
varoptions={
quality:50,
destinationType:Camera.DestinationType.DATA_URL,
sourceType:Camera.PictureSourceType.CAMERA,
allowEdit:true,
encodingType:Camera.EncodingType.JPEG,
targetWidth:100,
targetHeight:100,
popoverOptions:CameraPopoverOptions,
saveToPhotoAlbum:true,
correctOrientation:true
$cordovaCamera.getPicture(options).then(function(imageData){
$scope.data.imageSrc=&data:image/base64,&+imageD
},function(err){
}elseif(index=='1'){
document.addEventListener(&deviceready&,function(){
//从手机相册选择
varoptions={
destinationType:Camera.DestinationType.FILE_URI,
sourceType:2,//设为0或2,调用的就是系统的图库
quality:50,
allowEdit:true,
targetWidth:200,
targetHeight:200
$cordovaCamera.getPicture(options).then(function(imageURI){
$scope.data.imageSrc=imageURI;
},function(err){
});//$cordovaCamera.cleanup().then();//onlyforFILE_URI
},false);}
3.在视图上绑定
以上是的内容,更多
的内容,请您使用右上方搜索功能获取相关信息。
若你要投稿、删除文章请联系邮箱:zixun-group@service.aliyun.com,工作人员会在五个工作日内给你回复。
新用户大礼包!
现在注册,免费体验40+云产品,及域名优惠!
云服务器 ECS
可弹性伸缩、安全稳定、简单易用
&40.8元/月起
预测未发生的攻击
&24元/月起
你可能还喜欢
你可能感兴趣
阿里云教程中心为您免费提供
ngCordova安装与插件的使用
--相机拍摄和本地相册选择照片相关信息,包括
的信息,所有ngCordova安装与插件的使用
--相机拍摄和本地相册选择照片相关内容均不代表阿里云的意见!投稿删除文章请联系邮箱:zixun-group@service.aliyun.com,工作人员会在五个工作日内答复
售前咨询热线
支持与服务
资源和社区
关注阿里云
International什么是ngCordova
ngCordova是在Cordova Api基础上封装的一系列开源的AngularJs服务和扩展,让开发者可以方便的在HybridApp开发中调用设备能力,即可以在AngularJs代码中访问设备能力Api。ngCordova是结合cordova和angular包装了许多插件,诸如访问文件,摄像头,GPS等等,这些插件只需要简单配置就可以在ionic中使用。
如何安装配置
ngCordova使用很简单,首先在项目目录下,使用bower工具安装
bower install ngCordova
然后将ng-cordova.js或者ng-cordova.min.js添加到index.html中的cordova.js引入之前
&script src="lib/ngCordova/dist/ng-cordova.js"&&/script&
&script src="cordova.js"&&/script&
在js中添加ngCordova依赖
angular.module('myApp', ['ngCordova'])
在使用每个插件之前,必须先检测设备是否就绪
$ionicPlatform.ready(function() {
$cordovaPlugin.someFunction().then(success, error);
安装配置可能遇到的问题
1.没有bower命令
Bower 是 twitter 推出的一款包管理工具,基于nodejs的模块化思想,把功能分散到各个模块中,让模块和模块之间存在联系,通过 Bower 来管理模块间的这种联系。
安装bower非常简单,只要你安装了npm,可以用以下命令
npm install bower -g1.没有git环境
也许你会遇到 git is not installed or not in the PATH的报错,那是因为你计算机没有git环境支持,Git是分布式版本控制系统,ngCordova利用其控制插件版本更新
window环境的git从可以下载已经集成好的gif,直接然后按默认选项安装即可。
安装完成后,将git所在bin和cmd目录添加到系统环境变量
还需要最后一步设置,在命令行输入:
git config --global user.name "Your Name"
git config --global user.email ""
Ionic 添加ngCordova插件
Cordova+Angularjs+Ionic混合开发入门篇(一)----- ionic环境搭建
Ionic开发环境搭建
ionic3的安装、使用
Ionic开发入门教程_1
ionic插件基础(四)——ngCordova配置安装及ngCordova相机插件的使用
为Cordova + Ionic + AngularJS 应用添加微信分享功能
二维码扫描
ngCordova插件(0)-ngCordova插件的使用详解_序
ionic项目之ngcordova插件
没有更多推荐了,cordova + ionic 使用中碰到的一些问题 - AiDaRLING - 博客园
cordova&+&ionic&使用中碰到的一些问题
No Content-Security-Policy meta tag found. Please add one when using the cordova-plugin-whitelist plugin.解决办法index.html 中添加《meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'"》2、ionic 隐藏 nav-bar文档上来看,需要在controller中调用&&$ionicNavBarDelegate例如 .controller('DashCtrl', function ($scope, $ionicNavBarDelegate) {&&&&$ionicNavBarDelegate.showBar(false);})但没起作用。最后在模板中使用标签方法hide-nav-bar = "true"该方法起作用。3、 ng-model 与 input 值的问题例如&&&input type="text" ng-model="querystr"ng-model绑定到$scope.querystr 时,model会根据 text输入自动变化,但在controller中将$scope.querystr=''时 ,text input的值不会产生变化。并且在使用ng-model时,无法使用angular.element(document).find(selector).val("some value");方式进行赋值。解决方法是在controller 中,设置一个结构,如$scope.queryMode ={querystr:''};在input 中绑定&&ng-model = "queryModel.querystr"则controller中重设&&&$scope.queryMode.querystr = '';绑定生效,input 清空。4、cordova插件 ,在ripple中弹出错误窗口如果安装cordova插件,如keyboard,statusbar 等, 会在ripple中抛各种错,并且每次加载会弹出窗口,让你写JSON回调, 这个是ripple的BUG,不支持自定义插件, 去掉弹窗的办法是在app.js上方,即定义angular.module()的上方写
var annoyingDialog = parent.document.getElementByIdx_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x_x('exec-dialog');
上句中的x_x 去掉,新浪自动添加的。
if (annoyingDialog) annoyingDialog.outerHTML = "";
弹窗将不再出现,但输出窗口中的ripple.js中的错误仍会,你可以过滤,也可以不管。
5、使用极光推送,按照github上的说明文档,加入插件后总是无法编译,查看
是由于 platform/android/AndroidManifest.xml &中
meta-data android:name=JPUSH_APPKEY android:value=aaabbbbmn9QITAv0Oe
重复,每次build总会生成两条键值
经查在plug/android.json 中,有两条重复生成的语句,删掉一个,即可。6、ionic关于IFAME的调用因为使用第三方接口,会造成跑到应用外的地址,ionic无法控制外部连接回到应用,因此一般使用iframe方式打开外部连接,并加一个headbar用来返回到应用,如在modal中打开外部地址如html中&《script id="login.html" type="text/ng-template"》&&&&&&&&《ion-modal-view》&&&&&&&&&&&&《ion-header-bar align-title="center" class="bar-positive"》&&&&&&&&&&&&&&&&《div class="buttons"》&&&&&&&&&&&&&&&&&&&&《button&&class="button button-clear button-icon icon ion-ios-arrow-back"》《/button》&&&&&&&&&&&&&&&&&&&&《button ng-click="closeModal()" class="button button-clear button-icon icon "》取消《/button》&&&&&&&&&&&&&&&&《/div》&&&&&&&&&&&&&&&&《h1 class="title"》LOGIN《/h1》&&&&&&&&&&&&《/ion-header-bar》&&&&&&&&&&&&《ion-content scroll="true" class="has-header no-padding"》&&&&&&&&&&&&&&&&《iframe id="ifmr2" data-tap-disabled="true" ng-src="{{chatStru.paySrc}}"》《/iframe》&&&&&&&&&&&&《/ion-content》&&&&&&&&《/ion-modal-view》《/script》controller中$scope.tt = new Date().getMilliseconds();$scope.chatStru = {&&&&&&&&paySrc: $sce.trustAsResourceUrl('http://xxx.om/testlogin.jsp?tt='+$scope.tt),&&&&&&&&token: "",&&&&&&&&hasToken: false&&&&};$ionicModal.fromTemplateUrl('login.html', {&&&&&&&&scope: $scope,&&&&&&&&animation: 'slide-in-up'&&&&}).then(function (modal) {&&&&&&&&&&&&$scope.modal =&&&&});&&&&$scope.openModal = function () {&&&&&&&&&&$scope.modal.show();&&&&};&&&&&$scope.closeModal = function () {&&&&&&&&$scope.modal.hide();&&&&};
但这样的问题是在于,页面完成后,你必须通过手动点击返回,并且无法进行数据的传递,这个在html5中其实已经有了非常完美的解决方法就是postMessage()在远端的被iframe的页面中,加入JSwindow.onload=function(){&&&&&&&&&&&&&window.parent.postMessage('logined','*');&&&&&&&&}并在inoic的controller中加入&window.addEventListener('message', function (e) {&&&&&&&&var data = e.//这里返回的是 logined,相当于传递参数回来。&&&&&&&&$scope.modal.hide();&&&&}, false);&&你会发现,你即接收到了data,同时又关闭了该modal ,而不需要手动关闭。
当然,你可以将 addEventListener() 放到&$scope.openModal&
然后在 $scope.closeModal 中 removeEventListener()
&$scope.openModal = function () {
&&&&&&&&var tt = new Date().getMilliseconds();
&&&&&&&&$scope.chatStru.paySrc = $sce.trustAsResourceUrl('http://xxx.cn/oe/testlogin.jsp?tt=' + tt);
&&&&&&&&$scope.modal.show();
&&&&&&&&window.addEventListener('message', function (e) {
&&&&&&&&&&&&var data = e.
&&&&&&&&&&&&$scope.chatStru.hasToken =
&&&&&&&&&&&&$scope.modal.hide();
&&&&&&&&}, false);
&&&&// function to close the modal
&&&&$scope.closeModal = function () {
&&&&&&&&$scope.modal.hide();
&&&&&&&&if ($scope.chatStru.hasToken) {
&&&&&&&&&&&&window.removeEventListener('message', function () { }, false);
最终可以这样写
&var handel = function (e) {
&&&&&&&&var data = e.
&&&&&&&&if (data.id & 0) { &// 传回来的为json{id:1,msg:'aaa'}
&&&&&&&&&&&&if (!$scope.chatStru.hasToken) {
&&&&&&&&&&&&&&&&$scope.chatStru.hasToken =
&&&&&&&&&&&&}
&&&&&&&&&&&&$scope.modal.hide();
&&&&&&&&} else {
&&&&&&&&&&&&$scope.chatStru.hasToken =
&&&&$scope.openModal = function () {
&&&&&&&&var tt = new Date().getMilliseconds();
&&&&&&&&$scope.chatStru.paySrc = $sce.trustAsResourceUrl('http://xxx.cn/oe/testlogin.jsp?tt=' + tt);
&&&&&&&&$scope.modal.show();
&&&&&&&&if (!$scope.chatStru.hasToken) {
&&&&&&&&&&&&window.addEventListener('message', handel, false);
&&&&$scope.closeModal = function () {
&&&&&&&&$scope.modal.hide();
&&&&&&&&if ($scope.chatStru.hasToken) {
&&&&&&&&&&&&window.removeEventListener('message', handel, false);
&&&&};7、使用android studio 运行cordova项目直接使用platfrom目录里的gradle 可以在android studio中直接导入 cordova的项目,但运行模拟器时出现Cannot&reload&AVD&list:&cvc-enumeration-valid:&Value&'280dpi'&is&not&facet-valid&with&respect&to&enumeration&'[ldpi,&mdpi,&tvdpi,&hdpi,&xhdpi,&400dpi,&xxhdpi,&560dpi,&xxxhdpi]'.&It&must&be&a&value&from&the&enumeration.Error&parsing&D:\sdkforas\android-sdk-windows\system-images\android-22\android-wear\armeabi-v7a\devices.xmlcvc-enumeration-valid:&Value&'280dpi'&is&not&facet-valid&with&respect&to&enumeration&'[ldpi,&mdpi,&tvdpi,&hdpi,&xhdpi,&400dpi,&xxhdpi,&560dpi,&xxxhdpi]'.&It&must&be&a&value&from&the&enumeration.Error&parsing&D:\sdkforas\android-sdk-windows\system-images\android-22\android-wear\x86\devices.xml解决方法 :用/sdk/tools/lib/devices.xml去替换 system-images\android-22\android-wear\x86\devices.xml和system-images \android-22\android-wear\armeabi-v7a\devices.xml中的devices.xml8、 android studio 中 gradle 失败gradle&project&sync&failed.Basic&functionality(e.g.editing,debugging)&will&not&work&properly.解决方法:android&studio中,点击&tools&-&Android-&sync&project&with&gradles&files.9、加载远程js或css&出现&Refused&to&load&the&script&&或 Refused to load the stylesheetbecause it violates&the&following ....例如 index.html中 加载字体《link href='http://fonts.useso.com/css?family=RobotoDraft:400,500,700,400italic' rel='stylesheet'》可在index.html添加安全许可《meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline' http://fonts.useso. script-src 'self' 'unsafe-inline' 'unsafe-eval';"》直接加根域名即可,另外不要带引号 js&&需要添加在 script-src 中。10 、 ionic 中 弹出键盘遮挡住输入框在config.xml 中修改全屏为FALSE并添加&&adjustPan&&(adjstResize没有成功)&《preference name="Fullscreen" value="False" /》&&《preference name="android-windowSoftInputMode" value="adjustPan"/》11、ionic监听滚动网上的示例xxx.bind('scroll',function(){.....}),很容易将页面跑死, 换个思路,使用监听touchvar targetPos = window.screen.availH&$("#scdiv").on("touchend", function () {if (currpos & 10 && currpos & targetPos / 4) {&&&&&&&&&&&&&&&&$ionicScrollDelegate.$getByHandle('homescroll').scrollTo(0, 0, true);&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&} else if (currpos &= targetPos / 4 && currpos &= targetPos - 10) {&&&&&&&&&&&&&&&&$ionicScrollDelegate.$getByHandle('homescroll').scrollTo(0, targetPos - 64, true);&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&}})当触摸结束时,判断当前的位移,来做一些操作。这样在性能上提高了许多。$ionicScrollDelegate.$getByHandle 操作的是在html中定义的delegate-handle如《ion-content id="scdiv" delegate-handle="homescroll"》12、 APP开启检测网络并提示开启需要三个插件1、https://github.com/apache/cordova-plugin-network-information2、https://github.com/apache/cordova-plugin-dialogs3、https://github.com/deefactorial/Cordova-open-native-settings然后在APP.JS中,divicesReady中$ionicPlatform.ready(function () {if (navigator.connection) {&&&&&&&&&&&&var tmptypes = navigator.connection.&&&&&&&&&&&&if (tmptypes.toUpperCase().indexOf('NONE') & -1 || tmptypes.toUpperCase().indexOf('UNKNOWN') & -1) {&&&&&&&&&&&&&&&&if (navigator.notification) {&&&&&&&&&&&&&&&&&&&&navigator.notification.confirm(&&&&&&&&&&&&&&&&&&&&'您的设备未开启网络',&&&&&&&&&&&&&&&&&&&&&&&function (buttonIndex) {&&&&&&&&&&&&&&&&&&&&&&&&&&&&&if (buttonIndex == 1) {&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&if (cordova.plugins.settings) {&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&cordova.plugins.settings.openSetting("wifi", function () { console.log("network setting openning"); }, function () { console.log("open network setting failed"); });&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&}&&&&&&&&&&&&&&&&&&&&&&&&&&&}&&&&&&&&&&&&&&&&&&&&&&&&&},&&&&&&&&&&&&// callback to invoke with index of button pressed&&&&&&&&&&&&&&&&&&&&&&&'提示',&&&&&&&&&&&// title&&&&&&&&&&&&&&&&&&&&&&&['开启', '取消']&&&&&// buttonLabels&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&);&&&&&&&&&&&&&&&&}&&&&&&&&&&&&}&&&&&&&&}})其中openSettings中可设置以下本地设置
var&settingNames&=&array(
&&&&"open",
&&&&"accessibility",
&&&&"add_account",
&&&&"airplane_mode",
&&&&"apn",
&&&&"application_details",
&&&&"application_development",
&&&&"application",
&&&&"bluetooth",
&&&&"captioning",
&&&&"cast",
&&&&"data_roaming",
&&&&"date",
&&&&"device_info",
&&&&"display",
&&&&"dream",
&&&&"home",
&&&&"input_method",
&&&&"input_method_subtype",
&&&&"internal_storage",
&&&&"locale",
&&&&"location_source",
&&&&"manage_all_applications",
&&&&"manage_applications",
&&&&"memory_card",
&&&&"network_operator",
&&&&"nfcsharing",
&&&&"nfc_payment",
&&&&"nfc_settings",
&&&&"print",
&&&&"privacy",
&&&&"quick_launch",
&&&&"search",
&&&&"security",
&&&&"settings",
&&&&"show_regulatory_info",
&&&&"sound",
&&&&"sync",
&&&&"usage_access",
&&&&"user_dictionary",
&&&&"voice_input",
&&&&"wifi_ip",
&&&&"wifi",
&&&&"wireless");
其中相关网络的为wifi&&移动数据开启未找到。谁试出了是哪个请告诉我13、$sate.go&&和 $stateParams 传参及收参在 controller1 中使用&&$state.go('statename',{id:1}) ;传递参数在 statename 相对应的&&controller2 中接收参数$scope.id = $stateParams.注意,此处必须在router.js 中设置 statename 的参数形式如.state('statename ', {&&&&url: '/statename ',&&&&params: { 'id': null },&&&&templateUrl: 'templates/Users/statename .html',&&&&controller: 'controller2 '})其中params: { 'id': null }, 对应$state传的参,若不设,则必为undefined14、关于ionic中想底部加一长按钮,随页面滚动位置不变,例如最初的方案是在 ion-content&&外 ion-view 内添加一层div .....style= ..... position:fixed&&&&bottom:0之类,但最终发现,在不同分辨率下位置并不正确基本可确定是因为statusbar等的缘故,仔细看了下ionic.css最终发现,太简单了div class="tabs"&&就可以了。15、php中取值问题ionic中用的$http&&method:post ,params........在PHP中用$_POST取不到值, 改成 $_Request 就行了。16、使用vs2015 release会提示使用发布配置进行调试时,Android 程序包必须已签名。要配置 Android 签名,请按照 http://go.microsoft.com/fwlink/?LinkID=613579 中的说明操作(该网页很难打开)实际需要在项目根目录的build.json中添加生成的keystore{&&&&&"android": {&&&&&&"release": {&&&&&&&&"keystore": "E:\\Projects\\android.keystore",&&&&&&&&"storePassword": "*******",&&&&&&&&"alias": "********",&&&&&&&&"password": "*******",&&&&&&&&"keystoreType": ""&&&&&&}&&&&&}&}至于生成keystore 请百度,只要有jdk 运行命令就OK17、ionic 的滚动优化在app.js中的config 块中,加入$ionicConfigProvider.scrolling.jsScrolling(false);默认所有的滚动使用native,会比js的滚动快很多,并且很平滑,但这样做的话,无法使用一些效果,如has-bouncing="true"(仿苹果的一种上下拉显示背景的弹性效果)那你可以在特定的view中,ion-content中加入overflow-scroll="false",则该view保持js滚动18、微信支付支付宝支付非常简单,文档也很丰富,微信的相对来说低了不止一个档次,当然最郁闷的一件事是经过了数天的查错,发现微信的totalfee 居然是以分为单位,换句话来说,你传价格时,只会有整数如果出现0.01,那必然出错。19 ion-header-bar 下总是有条横线,即使设为border:none也没有作用。经查,添加background-size: 100% 0 即可解决。需要安装ngcordova的js文件,下载zip包,把ng-cordova.js和copy进相应的目录,在页面中引入即可
Get the Source File
You can use bower to install ngCordova like so or , and locate the .js file in the dist folder:
$ bower install ngCordova
Include ng-cordova.js or ng-cordova.min.js in
your index.html file before cordova.js and after your
AngularJS / Ionic file (since ngCordova depends on AngularJS).
&script src="lib/ngCordova/dist/ng-cordova.js"&&/script&
&script src="cordova.js"&&/script&
Inject as an Angular dependency
Then, include ngCordova as a dependency in your angular module:
angular.module('myApp', ['ngCordova'])
Wrap each plugin call with the deviceready event - important !
Before each plugin you must check if your device has fully loaded, and if the plugins are available using a native cordova event called deviceready.
Implement it like so:
document.addEventListener("deviceready", function () {
$cordovaPlugin.someFunction().then(success, error);
}, false);
// OR with IONIC
$ionicPlatform.ready(function() {
$cordovaPlugin.someFunction().then(success, error);
Add the plugin to your project using the Cordova CLI
Now you can add plugins to your cordova project, and use the ngCordova API detailed below:
cordova plugin add ...
Ionic 添加ngCordova插件
ionic添加cordova插件-ZIP
ionic开发-使用ngCordova增强设备调用能力
ionic插件基础(四)——ngCordova配置安装及ngCordova相机插件的使用
ionic添加cordova插件-AppVersion
没有更多推荐了,一,$cordovaDialogs(插件)http://ngcordova.com/docs/plugins/dialogs/有一个问题是上运行和移动设备上运行的确定和取消按钮的位置是反的(移动设备上是正确的)也可以用ionic的http://www.ionicframework.net/docs/api/service/$ionicPopup/(没试,忘了ionic自己有)二,$cordovaToast(短消息插件)http://ngcordova.com/docs/plugins/toast/注意:使用此插件,在浏览器调试时会报错,因为这个特殊插件只能在移动设备上起作用三,$cordovaProgress(进度条插件)http://ngcordova.com/docs/plugins/progressIndicator/报错没找到原因,改为用ionic的$ionicLoadinghttp://www.ionicframework.net/docs/api/service/$ionicLoading/#四,$cordovaFile(文件读写插件)http://ngcordova.com/docs/plugins/file/注意更新ngcordova和对应的插件,好像参数不对应导致一开始报编码错误$cordovaFile.checkFile(cordova.file.dataDirectory, &some_file.txt&)
.then(function (success) {
// success
}, function (error) {
});$cordovaFile.readAsDataURL(cordova.file.externalRootDirectory, &DCIM/Camera& + imageURI.substring(imageURI.lastIndexOf('/')))
.then(function (success) {
$scope.images_list.push(success);
}, function (error) {
alert(&error&+error);
});只试用过确认文件是否存在和读取文件为64位编码的的方法(第一个path参数只能写它指定的几种,不能写完整路径,第二个name参数补齐剩下的路径加上文件名)
无相关信息}

我要回帖

更多关于 无线360度全景摄像头 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信