离子的Android按键不灵 [英] Ionic android button not working
问题描述
林面临着我的离子的应用程序有问题。我codeD整个应用程序在web浏览器通过离子服务。现在,我要发布一个Android设备上我的应用程序。
Im facing a problem with my ionic app. I coded the whole app over the webbrowser through ionic serve. Now I want to publish my app on an android device.
在网页一切正常,但是当我点击登录页面上的登录按钮时,我试着开始我的Android 4.3或5.5的设备没有应用情况。
In the web everything works fine but when I try to start the app on my android 4.3 or 5.5 device nothing happens when i click the login button on the login page.
这是我的登录模板:
<ion-view view-title="Anmelden" name="login-view">
<ion-content class="padding">
<div class="list list-inset">
<label class="item item-input">
<input type="text" placeholder="Username" ng-model="data.username">
</label>
<label class="item item-input">
<input type="password" placeholder="Passwort" ng-model="data.password">
</label>
</div>
<button class="button button-block button-positive" ng-click="login(data)">Login</button>
</ion-content>
</ion-view>
我的路由(简体),它在我的app.js run函数后:
my routing (simplified), it's in my app.js after the run function:
.config(function ($stateProvider, $urlRouterProvider, USER_ROLES) {
$stateProvider
.state('login', {
url: '/login',
templateUrl: 'templates/login.html',
controller: 'LoginCtrl'
})
$urlRouterProvider.otherwise('/login');
})
在我LoginCtrl的实际功能没有得到所谓的,所以我认为我的模板不知何故没有连接到它的路由。
该按钮只是出现死了,没有任何反应,当你preSS它(也监测了我的网络服务器传入的HTTP请求)。
The actual function in my LoginCtrl is not getting called, so I assume that my template somehow has no connection to it's routing. The button just appears dead and nothing happens when you press it (also monitored incoming http requests on my webserver).
我也试图从改变NG-点击上抽头。
有人可以帮我吗?非常感谢。
I also tried to change from ng-click to on-tap. Can somebody help me? Thanks a lot.
问候
推荐答案
在 index.html的
添加到您的标题(请参阅 http://content-security-policy.com/ )
Add this to your header in index.html
(refer http://content-security-policy.com/)
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">
和您应该添加科尔多瓦-插件白名单
到项目(指的 https://github.com/apache/cordova-plugin-whitelist )
And you should add cordova-plugin-whitelist
to your project (refer https://github.com/apache/cordova-plugin-whitelist)
cordova plugin add cordova-plugin-whitelist
并添加以下行到你的 config.xml中
<access origin="*" />
<allow-intent href="*" />
这篇关于离子的Android按键不灵的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!