मैं मैं इस पर गलत हो रहा क्या नहीं समझ सकता मेरी कोड के साथ एक समस्या का सामना करना पड़ रहा में एक समारोह नहीं है .. दिलचस्प चीजें हैं जो एपीआई काफी अच्छा बुला रहा है लेकिन इसकी success
समारोह में नहीं जा रहा है orders.pay(ss($scope.ss, $scope.oo)) .success(function (data) {
त्रुटि सफलता AngularJS
angular.module('services.orders', ['users.service'])
.factory('orders', ['$http', 'user', '$q', function ($http, user, $q) {
'use strict';
function genericSuccess (res) {
return res.data.data; // yes, really.
}
function pay (payment) {
return $http.post('v1/payment/authorize', payment)
.then(genericSuccess);
}
orders.pay(ss($scope.ss, $scope.oo))
.success(function (data) {
//It should called success either it should gone to error but it says
//Error:orders.pay(...).success is not a function
//can any one suggest how to solve it
notify.message('Thank you!');
}).error(function (data) {
notify.message('Error: ' + data.data.message);
});
'ऑर्डर' फ़ंक्शन कैसा दिखता है? अगर आप कर सकते हैं, इसे पोस्ट करें। – mtndesign
'success' और '.error' को बहिष्कृत किया गया है, भले ही यह आपके मुद्दे का कारण न हो, आपको वास्तव में उनका उपयोग करने से बचना चाहिए। इसके बजाए '.then' और '.catch' का उपयोग करें। – ste2425