2016-08-05 4 views
0

送信ボタンの下に表示するのではなく、応答をポップアップメッセージにするために助けが必要です。投稿時にイオンポップアップエラーメッセージを表示するには

template.html

<div class="item item-text-wrap"> 
         Response: <b ng-bind="response"></b> 
        </div> 

app.js私は、応答メッセージに

// An alert dialog 
$scope.showAlert = function() { 
    var alertPopup = $ionicPopup.alert({ 
    title: 'Don\'t eat that!', 
    template: 'It might taste good' 
    }); 

    alertPopup.then(function(res) { 
    console.log('Thank you for not eating my delicious ice cream cone'); 
    }); 
}; 

答えて

0

app.js

をこのポップアップダイアログを追加するワン

$http.post(link, { 
      inputName : $scope.data.inputName 

     }).then(function (res){ 
      $scope.response = res.data; 
     }); 

app.js

$http.post(link, { 
    inputName : $scope.data.inputName 
}).then(function (res){ 
    // $scope.response = res.data; 
    $ionicPopup.alert({ 
    title: 'Success!', 
    template: res.data 
    }); 
}); 
+0

私はres.data形式のデータをこのようにすることができますgrapする必要がありますか?テンプレート:(res.data); – velvetInk

+0

は動作しているようです – velvetInk

+0

かっこが必要ですか? – velvetInk

関連する問題