Open Khandagale-Saurabh opened 2 years ago
@track it is useful when we want to change data of object. if we not use then value will not update same examale as two way binding ;
Conditionanl rendering : if data available then show else show somthing else
ceo.last
ceo.first
iterator vs loop
iterator is used to get values of first and last
our elemt change only when newelemet !=old element without @track : changes was to shown on HTML. with @track changes show on html
conditional rendering : if(male) show car else show flower
replace visible with genger and explain
shadow dom it means element limit : parent css will not reflect to child compoentn
data fetch
le.
There are following hooks supported in LWC :
Constructor : Called when the component is created.
Connectedcallback : Called when the element is inserted into a document. This hook flows from parent to child.
RenderedCallback : Called after every render of the component. This lifecycle hook is specific to Lightning Web Components, it isn’t from the HTML custom elements specification. This hook flows from child to parent. Ie its not part of HTMLElement rather defined in LightningElement.
Disconnectedcallback : Called when the element is removed from a document. This hook flows from parent to child.
Errorcallback : Called when a descendant component throws an error. The error argument is a JavaScript native error object, and the stack argument is a string. This lifecycle hook is specific to Lightning Web Components, it isn’t from the HTML custom elements specification
Is wire method called multiple times during lifecycle of com
wire is reactive in nature: once data is avalibel update immediately [$] make it reactive $user.id
Decorator: @wire
object adapter:getObjectInfo adapter
getObjectInfos:-> more than 1 object
Data binding: write variable in js file and use in HTML with {variable name} {2+2} not allowed
Two way data binding : js to HTML and HTML to js input box create karo onkeyup()=> this.mytext=text;