我正面临离子警报的问题,我使用离子构建应用程序,我在代码中使用警报一些用于验证的目的,它在Android中运行良好但在iOS中它显示index.html因为它是#s标题,我googled但没有找到任何解决方案。所以我在stackOverflow上发布我的问题..我在RnD期间有一个链接,但它对我没用,这是链接: -
Phonegap alert dialog shows index.html on top of message
我在这里发布所有插件列表: -
com.ionic.keyboard 1.0.4 "Keyboard"
com.phonegap.plugins.PushPlugin 2.5.0 "PushPlugin"
cordova-plugin-admob 2.16.1 "AdMob Plugin Pro"
cordova-plugin-admobpro 2.18.0 "AdMob Plugin Pro"
cordova-plugin-android-permissions 0.10.0 "Permissions"
cordova-plugin-compat 1.0.0 "Compat"
cordova-plugin-console 1.0.2 "Console"
cordova-plugin-customurlscheme 4.1.5 "Custom URL scheme"
cordova-plugin-device 1.1.1 "Device"
cordova-plugin-extension 1.2.4 "Cordova Plugin Extension"
cordova-plugin-file 4.2.0 "File"
cordova-plugin-file-transfer 1.5.1 "File Transfer"
cordova-plugin-google-analytics 0.8.1 "Google Universal Analytics Plugin"
cordova-plugin-speechrecognizer 1.0.0 "SpeechRecognizer"
cordova-plugin-splashscreen 4.0.0 "Splashscreen"
cordova-plugin-whitelist 1.2.1 "Whitelist"
cordova-plugin-x-socialsharing 5.0.12-dev "SocialSharing"
cordova-plugin-x-toast 2.5.0 "Toast"
de.appplant.cordova.plugin.email-composer 0.8.2 "EmailComposer"
org.apache.cordova.inappbrowser 0.6.0 "InAppBrowser"
phonegap-plugin-barcodescanner 5.0.0 "BarcodeScanner"
这是一段代码: -
var myPopup = $ionicPopup
.alert({
template: '<div class="pop_bx"><label> Name</label><input type="text" ng-model="data.name"> <br/><label> Email</label><input type="email" ng-model="data.email"> <br/><label> Telephone</label><input type="tel" ng-model="data.telephone"> <br/><label>Comment</label> <textarea name="textarea" ng-model="data.message"></textarea></div>',
scope: $scope,
cssClass: 'yourclassfeedback',
buttons: [{
text: $translate
.instant('contactPage.btnCancel')
},
{
text: 'Submit',
type: 'button-positive',
onTap: function(e) {
console.log(e);
if (!$scope.data.name) {
alert('Please enter name');
} else if (!$scope.data.email) {
alert($translate
.instant('contactPage.emailvaid'));
} else if (!$scope.data.message) {
alert($translate
.instant('contactPage.message'));
}
});
&#13;
堆叠溢出这里有任何身体面对这个问题并解决它,是否有可能解决它?我刚刚在Android的iOS中遇到这个问题,它工作得很好。
任何帮助都会非常感谢!!!
由于
答案 0 :(得分:0)
您是否可以使用此代码,请将$ionicPopup
嵌入cotroller。
var alertPopup = $ionicPopup.alert({
title: 'Please enter name',
template: ''
});