2017-03-01 31 views
0

我面臨離子警報的問題,我使用離子建立應用程序,我使用警報一些在代碼驗證的目的,它的工作良好但在iOS中它顯示index.html,因爲它的標題,我GOOGLE了,但沒有找到任何解決方案,所以我張貼我的問題在這裏stackOverflow ..我有一個鏈接在我期間RnD但它對我沒有用,這裏是鏈接: -離子警報顯示index.html作爲在iOS標題,但與Android工作正常

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')); 
 
       } 
 
      });

有任何身在這裏堆棧溢出面對這個問題,並解決它,是有可能解決呢?我只是在Android中面臨這個問題,它的工作正常。

任何幫助將非常感謝!

感謝

回答

0

您可以使用此代碼,並請cotroller embaled $ionicPopup

var alertPopup = $ionicPopup.alert({ 
    title: 'Please enter name', 
    template: '' 
}); 
+0

感謝您的回覆,但我已經通過IonicPopup展示了它。我更新了你在那裏看到的問題。 – Siddharth

+1

好的,你可以使用科爾多瓦插件添加科爾多瓦插件對話框這個插件爲這裏是一個鏈接http://ngcordova.com/docs/plugins/dialogs/。它看起來像本機ios和android對話框。 – Johnty

+0

但它自動關閉我的反饋 – Siddharth

相關問題