我正按照此处的说明尝试发布我的Android应用:
http://ionicframework.com/docs/guide/publishing.html
但是,当我运行cordova build --release android时,我收到以下错误:
:lintVitalArmv7Release
/Users/xxx/Documents/xxx/xxx/platforms/android/res/values/arrays.xml:3: Error: "country_codes" is not translated in "ar" (Arabic), "bg" (Bulgarian), "ca" (Catalan), "cs" (Czech), "da" (Danish), "de" (German), "el" (Greek), "es" (Spanish), "eu" (Basque), "fi" (Finnish), "fr" (French), "he" (Hebrew), "hi" (Hindi), "hu" (Hungarian), "id" (Indonesian), "it" (Italian), "iw" (Hebrew), "ja" (Japanese), "ko" (Korean), "nl" (Dutch), "pl" (Polish), "pt" (Portuguese), "ru" (Russian), "sk" (Slovak), "sl" (Slovene), "sv" (Swedish), "tr" (Turkish), "zh-rCN" (Chinese: China), "zh-rTW" (Chinese: Taiwan, Province of China) [MissingTranslation]
<string-array name="country_codes"> …Run Code Online (Sandbox Code Playgroud) 这真让我抓狂.我正在研究Ionic应用程序(Cordova,Angular等).我有一个联系我们链接,其中包含mailto:href
href="mailto:info@somedomain.net?subject=my%20App"
Run Code Online (Sandbox Code Playgroud)
我已经阅读了无数帖子,说你必须删除
<access origin="*"/>
Run Code Online (Sandbox Code Playgroud)
从项目根目录中的config.xml中替换它:
<access origin="mailto:*" launch-external="true" />
Run Code Online (Sandbox Code Playgroud)
我做过的.当我运行ionic build它时会被添加到config.xml中platforms/android/res/xml.但无论我做什么,链接都不会在任何Android模拟器上打开邮件应用程序(即使在模拟器中配置了电子邮件).
可悲的是,我没有可以测试的设备 - 所以这只是一个模拟器的事情还是我错过了什么?
我正在写一个小型离子应用程序,并有一个问题.我正在使用侧面菜单和标签.我的一个视图中有一个离子滑动盒,当我从左到右擦拭这个幻灯片时,侧面菜单滑出.我已经阅读了离子论坛上的各种相关主题,但没有一个有效.
我已经尝试添加drag-content="false"到各种标签,并添加$ionicSideMenuDelegate.canDragContent(false);到我的控制器.
都没有奏效.我认为这是因为我正在使用侧边菜单,标签中包含选项卡和视图.继承我的代码:
的index.html
<ion-side-menus>
<!-- Header bar -->
<ion-side-menu-content ng-controller="NavCtrl" drag-content="false">
<ion-nav-bar class="bar-positive">
<ion-nav-back-button class="button-icon ion-ios7-arrow-back">
</ion-nav-back-button>
</ion-nav-bar>
<!-- Page content -->
<ion-nav-view drag-content="false" animation="slide-left-right"></ion-nav-view>
</ion-side-menu-content>
<!-- Side menu -->
<ion-side-menu side="left" class="side-menu">
<ion-header-bar class="bar bar-header bar-dark">
<h1 class="title">Menu</h1>
</ion-header-bar>
<ion-content has-header="true">
<div ng-if="authData.twitter" class="logged-in-user item item-avatar">
<img ng-src="{{authData.twitter.cachedUserProfile.profile_image_url}}"/>
<h2>Hello, {{authData.twitter.displayName}}</h2>
<p>Logged in via Twitter</p>
</div>
<div ng-if="authData.facebook" class="logged-in-user item item-avatar">
<img ng-src="{{authData.facebook.cachedUserProfile.picture.data.url}}"/>
<h2>Hello, {{authData.facebook.displayName}}</h2>
<p>Logged in via Facebook</p>
</div>
<ul class="list">
<li>
<a class="item …Run Code Online (Sandbox Code Playgroud) 请原谅我,如果这个问题对于SO来说太宽泛,但我很难找到我需要的任何例子,并认为有人可能能指出我正确的方向.
我刚刚开始使用Kendo UI mobile,我正在尝试找到一个教程或任何示例代码,用于在kendo ui mobile中创建/查询本地客户端websql数据库.文档中没有任何内容......
有人可以帮忙吗?
提前致谢
我正在写一个快速的一次性方法来将用户从旧表导入我的新蛋糕应用程序.我已将旧用户表(old_users)导入到我的蛋糕应用程序数据库中.基本上我只需要在old_users表中选择all,然后循环遍历它们并使用像$ newuser-> create('old_username','old_password')之类的东西将它们添加到新用户表中;
但是,我不想为临时表创建模型等,因为此导入只会运行一次.所以我的问题是 - 如何进行基本选择以从用户控制器中的蛋糕方法获取此表中的所有用户.我在想这样的话:
public function admin_importOldUsers() {
$db = $this->getDataSource();
$db->fetchAll('SELECT * FROM old_users');
}
Run Code Online (Sandbox Code Playgroud)
但它失败了,错误:
调用未定义的方法UsersController :: getDataSource()
我在文档中找不到如何从控制器中查询另一个db表(没有模型)....
有人能指出我正确的方向吗?
提前致谢
是否可以使用$ watch来监控对localStorage的更改?
我有一个工厂让设置/变得更简单
.factory('$localstorage', ['$window', function($window) {
return {
set: function(key, value) {
$window.localStorage[key] = value;
},
get: function(key, defaultValue) {
return $window.localStorage[key] || defaultValue;
},
setObject: function(key, value) {
$window.localStorage[key] = JSON.stringify(value);
},
getObject: function(key) {
return JSON.parse($window.localStorage[key] || '{}');
}
}
}]);
Run Code Online (Sandbox Code Playgroud)
在我的控制器中我有
.controller('CodesCtrl', function($scope, $localstorage) {
$scope.codes = $localstorage.getObject('codes');
...
Run Code Online (Sandbox Code Playgroud)
在另一个控制器中,我正在添加到本地存储.我想在localStorage更改后立即呈现更改.
我已经看过一些SO帖子使用像ngStorage这样的东西,但理想情况下我想避免这样做.
可能吗?有人能指出我正确的方向吗?
为了追求最好的MVC实践,我试图确保我的所有代码都遵循胖模型,因此可能会有人将注意力集中在下面,并告诉我我是否在正确的轨道上?
目前在我的应用程序中我有
ExpenseClaims hasMany Expenses
Expenses belongsTo ExpenseClaims
Run Code Online (Sandbox Code Playgroud)
在我的pages/admin_index.ctp中,我需要获得属于每个列出的ExpenseClaim的所有费用的总和.
所以,我能看到的最好的FMSC方式是在AppModel中加载ExpenseClaim模型
App::uses('ExpenseClaim', 'Model');
Run Code Online (Sandbox Code Playgroud)
然后在AppModel中有一个我可以在app控制器中使用的功能(因为它在appModel中),我可以传递ExpenseClaim ID,它将返回所有相关费用的总和.
这是最正确的MVC方式,而不是在控制器中完成所有操作吗?
提前致谢
我对Angular很新,我可能会遗漏一些明显但我有以下自定义过滤器:
propertyApp.filter('telLink', function() {
return function(tel) {
// To avoid interpolating error
if(typeof(tel) != undefined) {
// Remove any leading zeros
if(tel.charAt(0) === '0') {
tel = tel.substr(1);
}
tel = "44" + tel;
// Remove any internal whiespace
return tel.replace(" ", "");
}
}
Run Code Online (Sandbox Code Playgroud)
});
当我在视图中使用它时,我得到了这个:
Can't interpolate: tel:{{property.agent_phone | telLink}}
TypeError: Cannot call method 'charAt' of undefined
Run Code Online (Sandbox Code Playgroud)
有人能指出我正确的方向吗?提前致谢.
我有一个data()包含一些json 的对象。
有没有一种方法可以遍历对象并获取每个零件的键和值?
这是我到目前为止的内容:
function getFigures() {
var propertyValue = getUrlVars()["propertyValue"];
$.getJSON(serviceURL + 'calculator.php?value=' + propertyValue, function(data) {
figures = data.figures;
$.each(figures, function(index, figure) {
$('#figureList').append('<li> index = ' + data.figures.figure + '</li>');
});
});
$('#figureList').listview('refresh');
}
Run Code Online (Sandbox Code Playgroud)
json看起来像这样:
{"figures":{"value":"150000","completion":"10.00","coal":"32.40","local":"144.00","bacs":"35.00","landRegistry":"200.00","solFee":"395.00","vatOnSolFees":79,"stampDuty":1500,"total":2395.4}}
Run Code Online (Sandbox Code Playgroud)
很简单,很抱歉,我是jQuery的新手,所以在SO上找不到任何有用的东西。
我试过在SO找到了多个解决方案,但我显然失去了一些东西作为不管什么我尝试,我不能让粒子视图来改变表单提交的(或点击按钮)的基础.
这是代码:
propertyControllers.controller('HomeCtrl', ['$scope', 'SearchData', '$location',
function($scope, SearchData, $routeParams, $location) {
SearchData.set('postcode', $scope.postcode);
SearchData.set('radius', $scope.radius);
SearchData.set('minBeds', $scope.minBeds);
SearchData.set('minPrice', $scope.minPrice);
$scope.submit = function() {
$location.path('/properties');
}
}]);
Run Code Online (Sandbox Code Playgroud)
并在home.html部分
<input type="submit" class="topcoat-button--cta" value="Search">
Run Code Online (Sandbox Code Playgroud)
我的路由配置
var propertyApp = angular.module('propertyApp', [
'ngResource',
'ngRoute',
'propertyControllers'
]);
propertyApp.config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/home', {
templateUrl: 'partials/home.html',
controller: 'HomeCtrl'
}).
when('/properties', {
templateUrl: 'partials/property-list.html',
controller: 'PropertyListCtrl'
}).
when('/properties/:propertyId', {
templateUrl: 'partials/property-detail.html',
controller: 'PropertyDetailCtrl'
}).
otherwise({
redirectTo: 'home'
});
}]);
Run Code Online (Sandbox Code Playgroud)
有人能指出我正确的方向吗?文档似乎过于复杂,我发现的所有简单例子都做我正在做的事情......
我有一个使用Ionic(Cordova和Angular)构建的iOS应用。我的应用程序的版本1(已经发布了一段时间)使用HTML5 localStorage存储了一些数据。我准备发布版本2,但更新应用程序(我已经通过xcode,itunes和testflight安装进行了模拟)会擦除存储在localstorage中的所有数据。
看来localstorage db存储在Library / Caches /中,如果有帮助的话。
有关信息,我正在使用:
科尔多瓦3.9.2和离子1.1.1
在花了整整一天时间搜索SO和其他各个网站之后,我仍然不明智。
有办法防止这种情况吗?有兴趣听到在发行的cordova应用程序上使用localStorage的任何人的消息。
我对Angular很新,但是我试图将REST $从$ http抽象到工厂/资源,但我似乎无法将任何参数传递给它.虽然我读过但是找不到这个例子.
我的工厂代码(services.js):
myApp.factory("PropertyDb", function($resource, $log) {
return {
getProperties: function(onSuccess) {
var properties = $resource("http://myurl.com/get_properties.php?", {
callback: 'JSON_CALLBACK',
postcode: 'AA11AA',
minimum_beds: '3',
minimum_price: '97500'
},
{
fetch : {method:'JSONP'},
params: {postcode: 'BB11BB'} // This doesn't override the above or work without the above postcode
});
properties.fetch(
function success(response) {
console.log(response);
onSuccess(response.listing);
},
function error(response) {
console.log(response);
console.log("error");
}
);
},
Run Code Online (Sandbox Code Playgroud)
我的控制器代码:
myControllers.controller('PropertyListCtrl', ['$scope', 'PropertyDb',
function($scope, PropertyDb) {
$scope.properties = {};
// Adding the postcode below doesnt work...
PropertyDb.getProperties({postcode …Run Code Online (Sandbox Code Playgroud)