Posts

Showing posts from July, 2020

Javascript properties in lightning web component

    properties in lwc:-   In any programming languages we will need variables to hold data and in lightning web components we call them properties.   Property names in JavaScript are in  camel case while HTML  attribute names are in kebab case(dash-  separated) to match HTML  standards. For example a javaScript  property named  firstName  maps to   an   HTML  attribute named first -n ame .    In lightning web components  we have two types of properties those are Private and Reactive Properties Public Properties Getter    Non-Reactive Properties.               when ever  the values changes to the property  then it does not re-render the component             we don't need to use decorator  to define this type of property.     Example: testLwc.html < template > < lightning - card title = " Non-Reactive" >                  {description} <lightning button label = "change value" onclick = {changeHandler}></lightning-button> </lightning-card