How listens javascript uiComponent property works with magento 2?

A listens property of UI Component in Magento is used to track changes of a component’s property.

Any observable property changes happened, a function defined with listens property calls.

Let’s understand the listens:{} property with a simple example, Continue reading “How listens javascript uiComponent property works with magento 2?”

How to give alias to the require js file with requirejs-config JS magento 2?

Magento requirejs-config file provides an alias for the custom js file declared inside map or path object.

You can use an alias anywhere inside a template or other Require JS file in the Magento system.

Create a requirejs-config.js file in your module, Continue reading “How to give alias to the require js file with requirejs-config JS magento 2?”

How to passing Dynamic arguments from template to RequireJs in magento 2?

Magento template support script tag with X-MAGENTO-INIT declaration. You can pass dynamic PHP values to Javascript from a template file.

create demo.phtml file in your module to pass dynamic PHP value to Javascript, Continue reading “How to passing Dynamic arguments from template to RequireJs in magento 2?”