Decorators LWC
Decorators LWC
Decoratrors in LWC
DHANANJAY AHER
👾The Lightning Web Components programming model has three decorators that add
functionality to a property or function.
The ability to create decorators is part of ECMAScript, but these three decorators are
To expose a public method, decorate it with @api. Public methods are part
of a component’s API. To communicate down the containment hierarchy,
owner and parent components can call JavaScript methods on child
components.
output is :
Note: we can't access @track properties from outside as they are private and
only accessible within its component only.
Example :
Apex Class :
Source : https://developer.salesforce.com/docs/component-library/documentation/en/lwc/reference_decorators