Skip to main content
[Edit removed during grace period]
Source Link
Kishan Savaliya
  • 7.8k
  • 1
  • 13
  • 28
added 2 characters in body
Source Link
Kishan Savaliya
  • 7.8k
  • 1
  • 13
  • 28

Please use below code in your JS file

definerequire([
    "IOST",
    "jquery",
    "mage/url"
], function( iost, $, url ){

    console.log(url) ;
}); 
function transfer(){
    console.log(url.build) ;
}

OR you can use below code for your JS

definerequire(
    ['uiComponent', 'jquery', 'mage/url', 'Iostpay_Iostpaymagento::js/iost.min'],
    function (uiComponent, $, url, iost) {
        "use strict";
        return uiComponent.extend({
            initialize: function () {
                this._super();
                console.log(url);
            },

            transfer: function(){
                console.log(url.build) ;
            }
        });
    }
);

After changing this you need to run below commands

php bin/magento setup:upgrade
php bin/magento cache:clean
php bin/magento cache:flush

You can follow this JS to understand how you can build URLs with the use of urlBuilder and how to use mage/url in your knockout JS.

vendor/magento/module-gift-message/view/frontend/web/js/action/gift-options.js

Hope this will work for you!

Please use below code in your JS file

define([
    "IOST",
    "jquery",
    "mage/url"
], function( iost, $, url ){

    console.log(url) ;
}); 
function transfer(){
    console.log(url.build) ;
}

OR you can use below code for your JS

define(
    ['uiComponent', 'jquery', 'mage/url', 'Iostpay_Iostpaymagento::js/iost.min'],
    function (uiComponent, $, url, iost) {
        "use strict";
        return uiComponent.extend({
            initialize: function () {
                this._super();
                console.log(url);
            },

            transfer: function(){
                console.log(url.build) ;
            }
        });
    }
);

After changing this you need to run below commands

php bin/magento setup:upgrade
php bin/magento cache:clean
php bin/magento cache:flush

You can follow this JS to understand how you can build URLs with the use of urlBuilder and how to use mage/url in your knockout JS.

vendor/magento/module-gift-message/view/frontend/web/js/action/gift-options.js

Hope this will work for you!

Please use below code in your JS file

require([
    "IOST",
    "jquery",
    "mage/url"
], function( iost, $, url ){

    console.log(url) ;
}); 
function transfer(){
    console.log(url.build) ;
}

OR you can use below code for your JS

require(
    ['uiComponent', 'jquery', 'mage/url', 'Iostpay_Iostpaymagento::js/iost.min'],
    function (uiComponent, $, url, iost) {
        "use strict";
        return uiComponent.extend({
            initialize: function () {
                this._super();
                console.log(url);
            },

            transfer: function(){
                console.log(url.build) ;
            }
        });
    }
);

After changing this you need to run below commands

php bin/magento setup:upgrade
php bin/magento cache:clean
php bin/magento cache:flush

You can follow this JS to understand how you can build URLs with the use of urlBuilder and how to use mage/url in your knockout JS.

vendor/magento/module-gift-message/view/frontend/web/js/action/gift-options.js

Hope this will work for you!

added 262 characters in body
Source Link
Kishan Savaliya
  • 7.8k
  • 1
  • 13
  • 28

Please use below code in your JS file

define([
    "IOST",
    "jquery",
    "mage/url"
], function( iost, $, url ){

    console.log(url) ;
}); 
function transfer(){
    console.log(url.build) ;
}

OR you can use below code for your JS

define([
    "jquery"['uiComponent',
  'jquery', 'mage/url', "mage'Iostpay_Iostpaymagento::js/url"iost.min'],
    "IOST"
], function (uiComponent, $, url, iost) {
        "use strict";
    console    return uiComponent.logextend(url{
            initialize: function () {
                this._super();
}                console.log(url);
            },
function
            transfer: function(){
                console.log(url.build) ;
            }
        });
    }
);

After changing this you need to run below commands

php bin/magento setup:upgrade
php bin/magento cache:clean
php bin/magento cache:flush

You can follow this JS to understand how you can build URLs with the use of urlBuilder and how to use mage/url in your knockout JS.

vendor/magento/module-gift-message/view/frontend/web/js/action/gift-options.js

Hope this will work for you!

Please use below code in your JS file

define([
    "IOST",
    "jquery",
    "mage/url"
], function( iost, $, url ){

    console.log(url) ;
}); 
function transfer(){
    console.log(url.build) ;
}

OR you can use below code for your JS

define([
    "jquery",
    "mage/url",
    "IOST"
], function( $, url ){

    console.log(url) ;
}); 
function transfer(){
    console.log(url.build) ;
}

After changing this you need to run below commands

php bin/magento setup:upgrade
php bin/magento cache:clean
php bin/magento cache:flush

You can follow this JS to understand how you can build URLs with the use of urlBuilder and how to use mage/url in your knockout JS.

vendor/magento/module-gift-message/view/frontend/web/js/action/gift-options.js

Hope this will work for you!

Please use below code in your JS file

define([
    "IOST",
    "jquery",
    "mage/url"
], function( iost, $, url ){

    console.log(url) ;
}); 
function transfer(){
    console.log(url.build) ;
}

OR you can use below code for your JS

define(
    ['uiComponent', 'jquery', 'mage/url', 'Iostpay_Iostpaymagento::js/iost.min'],
    function (uiComponent, $, url, iost) {
        "use strict";
        return uiComponent.extend({
            initialize: function () {
                this._super();
                console.log(url);
            },

            transfer: function(){
                console.log(url.build) ;
            }
        });
    }
);

After changing this you need to run below commands

php bin/magento setup:upgrade
php bin/magento cache:clean
php bin/magento cache:flush

You can follow this JS to understand how you can build URLs with the use of urlBuilder and how to use mage/url in your knockout JS.

vendor/magento/module-gift-message/view/frontend/web/js/action/gift-options.js

Hope this will work for you!

added 225 characters in body
Source Link
Kishan Savaliya
  • 7.8k
  • 1
  • 13
  • 28
Loading
deleted 6 characters in body
Source Link
Kishan Savaliya
  • 7.8k
  • 1
  • 13
  • 28
Loading
Source Link
Kishan Savaliya
  • 7.8k
  • 1
  • 13
  • 28
Loading