How to define Require JS Plugin in Magento?

You can create Require JS plugin in Magento with text! as a suffix and pass HTML file path in the dependency of the define( ) method in javascript.

An Example of a text plugin in Magento,

'text!Jesadiya_Blog/template/plugin.html'

Continue reading “How to define Require JS Plugin in Magento?”

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