我有一个
< ion-side-menu >链接到我在此处定义的页面:
app.config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider) {
$stateProvider.state('content', {
url: "/content",
abstract: true,
templateUrl: "templates/sidemenu.html",
controller: 'SideController'
});
$stateProvider.state('content.home', {
url: "/home",
views: {
'menuContent': {
templateUrl: "templates/home.html",
controller: "HomeController"
}
}
});
$stateProvider.state('content.nearby', {
url: "/nearby",
views: {
'menuContent': {
templateUrl: "templates/nearby.html",
controller: "NearbyController"
}
}
});
$stateProvider.state('content.map', {
url: "/map",
views: {
'menuContent': {
templateUrl: "templates/map.html",
controller: "MapController"
}
}
});
$stateProvider.state('content.radar', {
url: "/radar",
views: {
'menuContent': {
templateUrl: "templates/radar.html",
controller: "RadarController"
}
}
});
$stateProvider.state('content.location-details', …Run Code Online (Sandbox Code Playgroud) 我刚开始接触Ionic Framework来编写我的第一个Android应用程序.
我可以设置项目,但是当我想通过'ionic platform add'添加Android平台时,它说:
' ? Error reading config file: Error: ENOENT, open 'D:\Projects\android2\config.xml'
Error happened: undefined'
Run Code Online (Sandbox Code Playgroud)
当我想通过'ionic build android'构建应用程序时,它说:'当前的工作目录不是基于Cordova的项目.'
当我从离子FAQ('cordova create')运行修复时,它说:
'At least the dir must be provided to create new project. See `cordova help`.'
Run Code Online (Sandbox Code Playgroud)
有谁知道为什么会发生这种错误?
编辑:在多台计算机上试过(Windows 7 64),得到了同样的错误.
我的插件有问题.当我在应用程序中,并且我通过Parse发送通知时,我会收到一条带有该消息的警报(这可以按预期工作).但是,当应用程序在后台时,手机上不会显示任何内容.以下是我如何使用插件,以及如何处理通知:
var gmcId = "xxxxxxx";
var androidConfig = {
senderID: gmcId
};
document.addEventListener("deviceready", function(){
$cordovaPush.register(androidConfig).then(function(result) {
console.log("result: " + result);
}, function(err) {
// Error
})
$rootScope.$on('$cordovaPush:notificationReceived', function(event, e) {
switch( e.event )
{
case 'registered':
if ( e.regid.length > 0 )
{
// Your GCM push server needs to know the regID before it can push to this device
// here is where you might want to send it the regID for later use.
console.log("regID = " + e.regid); …Run Code Online (Sandbox Code Playgroud) 我一直在做我的研究,似乎这在Ionic社区中并不是一个不常见的问题或问题.我有一个带有视图输入的简单表单:
<input type="text" id="firstName" placeholder="First Name" ng-model="registerData.firstName">
...
Run Code Online (Sandbox Code Playgroud)
在我的控制器中,我尝试着重于该领域:
document.getElementById("firstName").focus();
Run Code Online (Sandbox Code Playgroud)
当然它不起作用,所以我看到的一些帖子建议,我必须添加Ionic Keyboard Plugin.我这样做是通过运行:
cordova plugin add https://github.com/driftyco/ionic-plugins-keyboard.git
Run Code Online (Sandbox Code Playgroud)
然后我显然必须在我config.xml身上设置这个:
<preference name="KeyboardDisplayRequiresUserAction" value="false"/>
<feature name="Keyboard">
<param name="ios-package" onload="true" value="IonicKeyboard"/>
</feature>
Run Code Online (Sandbox Code Playgroud)
显然一切都应该有效......但事实并非如此.有什么我想念的吗?
我们正在使用Ionic框架开发android应用程序.
当我们点击输入文本框时,我们需要显示下一个按钮而不是返回按钮.在原生Android API中,我们可以选择显示下一个按钮.但在Ionic框架工作中,我们没有显示下一个按钮的选项.
如果选择输入文本框字段,如何在软键盘中添加下一个按钮?
我尝试将一个Ion-List添加到我的应用程序中,项目构建如| Image | Text | Button
图像和按钮垂直居中,但文本没有.
我尝试在互联网上找到一些CCS,它在浏览器预览中工作正常,但在真实设备上却没有(三星Galaxy S3 Mini,Android 4.1.2)
style="position: absolute; top: 50%; transform: translateY(-50%);"
码
<ion-content>
<ion-list>
<ion-item class="item-avatar item-icon-right" collection-repeat="x in y" href="#/pages/{{x.id}}">
<img src="img/{{x.icon}}.png">
<div style="position: absolute; top: 50%; transform: translateY(-50%);">{{x.name}}</div>
<i class="icon ion-chevron-right icon-accessory"></i>
</ion-item>
</ion-list>
</ion-content>
Run Code Online (Sandbox Code Playgroud)
在设备上
我正在使用Ionic构建我的应用程序,我在验证步骤中归档后出现此错误.
无法在Info.plist中找到平台系列CFBundleSupportedPlatforms或Mach-O LC_VERSION_MIN for A
在日志文件中,我可以找到此返回:
[myPath] /www/lib/phonegap-facebook-plugin/platforms/ios/FacebookSDK.framework/Versions/A"未包含"archived-expanded-entitlements.xcent"资源
我试图在我的.list文件中添加密钥CFBundleSupportedPlatforms; 使用XCode 6.4; 改变了目标架构等等.没有任何作用......
你有什么线索吗?
非常感谢
顺便说一句,我在xCode 7.0.1下运行.
我getData(url)在我的工厂中使用 以下方法$http.get(url)来从URL获取数据
angular
.module('az-app')
.factory('WebServiceFactory', function ($http, $q) {
var WebServiceFactory = this;
WebServiceFactory.getData = function (url) {
var deferred = $q.defer();
$http.get(url)
.then(
function (response) {
deferred.resolve({
data: response
});
}, function (rejected) {
deferred.reject({
data: rejected
});
}
);
//Promise to be returned
return deferred.promise;
}
Run Code Online (Sandbox Code Playgroud)
它工作正常,但我需要中止http.get和/或拒绝承诺,所以我可以显示来自我的控制器的错误消息,该消息具有以下方法:
var getSpecialties = function (type) {
doctorsCtrl.showLoading();
var url = "example.com";
WebServiceFactory.getData(url)
.then(
function (result) {
doctorsCtrl.hideLoading();
var specialtiesArray = result.data.data;
StorageFactory.specialties = …Run Code Online (Sandbox Code Playgroud) angularjs angularjs-service angularjs-factory ionic-framework ionic
我正在创建一个具有多个第三方集成的Ionic应用程序.我已经有一个java服务器,它为第三方执行oauth2身份验证,并重定向到服务器本身的回调URL.
现在我的任务是在服务器回调网址完成后打开应用页面.
我尝试了以下方法:在成功回调后使用离子和重定向监控应用程序中的URL更改.
这是处理这个问题的最佳方式.
谢谢.
我正试图在我的离子应用程序上做一些调试,我有一个Moto Maxx(国际版的Droid Turbo).问题是,检测到设备,但我的应用程序未列出chrome://inspect,如下面的屏幕截图所示.
PS:其他设备显示我的应用程序就好了.而这个问题也发生与其他摩托罗拉设备.
Discover USB devices已签入chrome://inspect.那么,我做错了什么?