0
如何在IBM worklight適配器成功函數後調用ng-controller
angular.js的方法?IBM Worklight 6.1 - 在成功的適配器調用後如何調用angular.js的ng-controller方法?
我使用以下功能:
$("#viewCont").bind('click', function() {
var input = {
adapter: "sampleAdapters",
procedure: "GetViewList",
parameters: [empId]
};
WL.Client.invokeProcedure(input, {
onSuccess: function viewinAngular($scope, data) {
demoArray = ["Dynamic Group Header - 1", "Dynamic Group Body - 1", "Dynamic Group Header - 2", "Dynamic Group Body - 2"];
qtyArr = [];
for (var i = 0; i < demoArray.length; i++) {
var dataObject = new Object();
dataObject.dateLocalForamt = '123456';
dataObject.statusString = 'canclelled';
dataObject.reqstNumbaa = '123456789';
dataObject.Product_Desc = 'asdf';
dataObject.Quantity = 10;
qtyArr.push(dataObject);
}
$scope.data = qtyArr;
},
onFailure: authFailure,
timeout: 180000
});
}
function authFailure(response) {
WL.SimpleDialog.show("Alert", 'Check your network connectivity.', [{
text: "OK",
handler: function() {}
}]);
}
有你看這裏:http://stackoverflow.com/questions/17204562/angularjs-how-do-you-call-a-controller-method-inside-a-javascript-function-defin – nspeete
你的代碼失敗了嗎?以什麼方式?有錯誤嗎?絕對回顧@ nspeete的建議答案。 –
@nspeete:我看了一下,但如果我使用$ http,那麼我將得到正確的答案,對於worklight,每個服務都需要通過適配器調用請求。一旦我調用過程ll獲取回調函數Onsuccess中的輸出,我將如何顯示在HTML中使用角js? – praveen