我们拥有可货币化的移动应用程序理念,并将构建我们的第一个移动混合应用程序.
我调查了几件事并想出要实现我的端到端目标,我需要:
前端UI框架:可能的选项:Ionic/AngularGap [但文档似乎解析].
然后我认为我们需要将PhoneGap用于各种平台.
有一个BackEnd框架 - Loopback/Parse
我还没有查看具体的文档,但如果路径正确,那么有经验的建议会非常有帮助.
我现在还不知道:
答:我的想法是对的,我该怎么做.
B. Ionic是一个UI框架,如何将其与Phonegap连接,如何访问本机功能.我想我必须用angular来调用Phonegap apis?
C.如果我设置了前端部分,如何将后端apis称为环回的api?通过REST调用?或者还有其他更有效的方法吗?
有没有更简单的方法来实现这一目标?
当我运行模拟ios时,我通过离子sidemenu应用程序我得到这些错误:
Usage of '--family' is deprecated in 3.x. Use --devicetypeid instead.
Usage of '--retina' is deprecated in 3.x. Use --devicetypeid instead.
Session could not be started: Error Domain=DTiPhoneSimulatorErrorDomain Code=2 "Simulator session timed out." UserInfo=0x7f91f97358b0 {NSLocalizedDescription=Simulator session timed
Run Code Online (Sandbox Code Playgroud)
黑屏是为模拟器而来的
这些是我的mac信息:yosemite 10.10 ios-sim版本3.0.0 cordova版本3.6.3-0.2.13离子版本1.2.6-beta1 xcode 6.1
我正在使用Ionic,并希望根据数据动态更改每个项目的背景颜色<ion-list>.我以为我会通过函数调用来返回正确的类
<ion-list>
<ion-item ng-repeat="singleCase in allCases" ng-class="getBackgroundColour(singleCase)" class="item-avatar">
<h2>{{singleCase.date}}</h2>
<p>{{singleCase.caseType}}</p>
</ion-item>
</ion-list>
Run Code Online (Sandbox Code Playgroud)
这是目前的控制器
.controller('AllCasesCtrl', ['$scope', '$log', 'dummyData', function($scope, $log, dummyData) {
$scope.allCases = dummyData.cases;
$scope.getBackgroundColour = function(singleCase){
$log.log("getBackgroundColour called...singleCase type: " + singleCase.speciality);
var colourMap = {
speciality1: "speciality1Class",
speciality2: "speciality2Class",
speciality3: "speciality3Class"
};
return colourMap[singleCase.speciality];
};
}])
Run Code Online (Sandbox Code Playgroud)
在检查控制台时,列表中的getBackgroundColour()每个函数被调用7次<ion-item>.为什么这样,我应该避免使用函数调用ng-class吗?
我在Android(Lollipop)设备上安装了一个Ionic app(beta 14),使用:
ionic platform add android
ionic run android
Run Code Online (Sandbox Code Playgroud)
我还手动构建了应用程序并使用adb安装它.
该应用程序使用离子侧菜单,简单视图(列表 - >详细信息 - >详细信息)之间过渡的动画在功能强大的手机上非常滞后.侧面菜单滑出时的动画相当平滑.
为了进一步调查这种情况,我从我的开发机器上提供了www目录,并在手机上的Chrome中打开了该页面,它就像人们期望的那样顺利.该应用程序也可以在iOS设备上顺利运行.
当应用程序处于离子状态时,有没有人知道为什么它如此缓慢,但是当它只是在浏览器中呈现时会按预期执行?
我正在开发一个离子聊天应用程序,用户可以在其中上传照片作为其消息的一部分.我正在寻找一种方法将图像上传到我的webhost服务器,以便稍后通过URL检索它.
问题是我无法将其上传到我的网络服务器.
我正在使用这两个插件:
当我在xcode模拟器中运行应用程序并从设备photolibrary中选择一张图片时,控制台会给我以下消息:
File Transfer Finished with response code 200void SendDelegateMessage(NSInvocation *): delegate (webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:) failed to return after waiting 10 seconds. main run loop mode: kCFRunLoopDefaultMode>SUCCESS: ""这是我目前使用的代码:
app.controller('HomeController', function($rootScope, $scope, $cordovaCamera, $ionicActionSheet, $cordovaFileTransfer){ ...
// open PhotoLibrary
$scope.openPhotoLibrary = function() {
var options = {
quality: 100,
destinationType: Camera.DestinationType.FILE_URI,
sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
allowEdit: true,
encodingType: Camera.EncodingType.JPEG,
popoverOptions: CameraPopoverOptions,
saveToPhotoAlbum: false
};
$cordovaCamera.getPicture(options).then(function(imageData) {
//console.log(imageData);
//console.log(options);
var url = "http://mydomein.com/upload.php";
//target path may be …Run Code Online (Sandbox Code Playgroud) 我希望onesignal能够将推送通知发送到特定设备.
如何捕获设备的设备ID?
我使用什么API推送到特定设备?
谢谢.
新版项目刚刚由离子(遵循离子站点上的说明)安装在macOs Sierra上.当我尝试运行ionic serve它失败时出现此错误:
TypeError: Cannot read property 'hasOwnProperty' of undefined
at Object.runr (/usr/local/lib/node_modules/ionic/lib/cli.js:191:19)
at /usr/local/lib/node_modules/ionic/lib/cli.js:54:9
at _fulfilled (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:749:13)
at /usr/local/lib/node_modules/ionic/node_modules/q/q.js:557:44
at flush (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:108:17)
at doNTCallback0 (node.js:419:9)
at process._tickCallback (node.js:348:13)
Cannot read property 'hasOwnProperty' of undefined (CLI v2.1.7)
Your system information:
Cordova CLI: 5.4.1
Ionic CLI Version: 2.1.7
Ionic App Lib Version: 2.1.4
ios-deploy version: 1.9.0
ios-sim version: 5.0.11
OS: macOS Sierra
Node Version: v4.2.4
Xcode version: Xcode 8.0 Build version 8A218a
Run Code Online (Sandbox Code Playgroud)
我已经卸载并重新安装了离子但仍然出现相同的错误.使用OS-X …
我有一个输入字段和一个按钮.它必须在启动时禁用.当输入无空白时,按钮启用.
我使用ngModel获取输入的值,并使用函数(更改)在每次更改输入时启动函数.
现在我在改变功能中做了一点.
if(input !== ''){
//enable the button
}else{
//disable the button
}
Run Code Online (Sandbox Code Playgroud)
你知道如何实现这个目标吗?
谢谢
我试图将我在https://github.com/bevacqua/dragula/issues/289#issuecomment-277143172上找到的代码用于我的Ionic项目.
当我运行代码时,我得到一个错误Cannot find namespace 'NodeJS',错误引用touchTimeout: NodeJS.Timer;
如何调整下面的代码以使NodeJS.Timer线路正常工作?
import { Directive, ElementRef, HostListener } from '@angular/core';
@Directive({ selector: '[delayDragLift]' })
export class DelayDragLiftDirective {
dragDelay: number = 200; // milliseconds
draggable: boolean = false;
touchTimeout: NodeJS.Timer;
@HostListener('touchmove', ['$event'])
// @HostListener('mousemove', ['$event'])
onMove(e: Event) {
if (!this.draggable) {
e.stopPropagation();
clearTimeout(this.touchTimeout);
}
}
@HostListener('touchstart', ['$event'])
// @HostListener('mousedown', ['$event'])
onDown(e: Event) {
this.touchTimeout = setTimeout(() => {
this.draggable = true;
}, this.dragDelay);
}
@HostListener('touchend', ['$event'])
// @HostListener('mouseup', …Run Code Online (Sandbox Code Playgroud) 嗨我有一个功能,它会在http请求到服务器后更新.似乎console.log显示该值已更新但UI未更新,除非我单击任何其他组件(例如输入).
这是我的功能:
fileTransfer.upload(this.created_image, upload_url, options)
.then((data) => {
console.log("success:"+data.response); //This is showing correct response
var obj = JSON.parse(data.response);
this.sv_value = obj.value;
console.log(this.sv_value); //This is showing correct value
}, (err) => {
console.log("failure:");
})
Run Code Online (Sandbox Code Playgroud)
这是我的观点html:
<ion-row>
<ion-col center width-100 no-padding>
<h2>{{sv_value}}</h2> //This is not updated
</ion-col>
</ion-row>
Run Code Online (Sandbox Code Playgroud)
有什么办法可以解决这个问题吗?谢谢
ionic-framework ×10
angular ×3
angularjs ×3
cordova ×3
ionic2 ×3
ios ×2
javascript ×2
android ×1
camera ×1
ionic ×1
ionic3 ×1
loopbackjs ×1
macos-sierra ×1
ngcordova ×1
onesignal ×1
performance ×1
uuid ×1
xcode ×1