This is my script from my phtml file:
<script type="text/x-magento-init">
{
"*": {
"Vendor_Namespace/js/custom": {
"ajaxShipmentUrl": "<?php echo $block->getUrl('vendor_namespace/ajax/scanShipment'); ?>"
}
}
}
</script>
I want to get the value of my ajaxShipmentUrl
paramater in the custom
js file.
This is the content of the custom
js file:
define([ 'jquery', 'jquery/ui'],
function ($) {
'use strict';
$.widget('mage.fulfillment', {
options: {
// Define variables
},
_init: function (config) {
console.log(config);
// ... the rest of the script
},
// ... the rest of the script
return $.mage.fulfillment;
});
Is there a way to get the ajaxShipmentUrl
in my _init
method ?
Thank you