I have button on checkout page with knowckout js to find pincodes with my API. Now I want to send one ajax request to that API.
define(
[
'jquery',
'ko',
'uiComponent'
],
function(
$,
ko,
Component
) {
'use strict';
$(document).on('click', '.common-place-order', function (event) {
});
}
);
So how do we call ajax request from knockout js?
I was trying to use this
myAjaxCall: function(dataToPass) { fullScreenLoader.startLoader(); return storage.post( 'url/of/mycontroller', JSON.stringify(dataToPass), true ).done( response
but instead of returning the response it return the whole javascript object.
– Zeeshan Khuwaja Jun 28 '18 at 02:45