2016-08-05 13 views
0

Ich brauche Hilfe, um die Antwort eine Popup-Nachricht zu machen, anstatt es unterhalb der Schaltfläche senden anzuzeigen.wie man ionische popup error message auf einreichen

template.html

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

app.js

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

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

app.js I wan dieses Popup-Dialog auf die Antwortnachricht hinzuzufügen

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

Antwort

0

app.js

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

Ich muss das Datumsformular erfassen res.data könnte das so aussehen? Vorlage: (res.data); – velvetInk

+0

scheint zu funktionieren – velvetInk

+0

brauche ich die Klammern? – velvetInk