How to define knockout property as observable in Magento 2?

Magento uses knockout Javascript to enhance some of its native features. You must have to know about the Knockout observable feature to use it.

knockout observables are used to get track changes of the current view model property. if you want to subscribe to a change of your view model objects, you must define your property or objects as observable. Continue reading “How to define knockout property as observable in Magento 2?”

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?”