Khandagale-Saurabh / Salesforce

1 stars 0 forks source link

LWC #16

Open Khandagale-Saurabh opened 2 years ago

Khandagale-Saurabh commented 2 years ago

image 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;

=> it is use to restrict the component
Khandagale-Saurabh commented 2 years ago

image @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 ;

Khandagale-Saurabh commented 2 years ago

Conditionanl rendering : if data available then show else show somthing else

Khandagale-Saurabh commented 2 years ago

image

ceo.last
ceo.first

image

image

iterator vs loop

iterator is used to get values of first and last

Khandagale-Saurabh commented 2 years ago

our elemt change only when newelemet !=old element without @track : changes was to shown on HTML. with @track changes show on html

image

Khandagale-Saurabh commented 2 years ago

conditional rendering : if(male) show car else show flower

replace visible with genger and explain image

Khandagale-Saurabh commented 2 years ago

image

Khandagale-Saurabh commented 2 years ago

image shadow dom it means element limit : parent css will not reflect to child compoentn

Khandagale-Saurabh commented 2 years ago

image data fetch

image

Khandagale-Saurabh commented 2 years ago

Step 1[]https://blog.salesforcecasts.com/life-cycle-hooks-in-lwc/

image image

image

image

image

Khandagale-Saurabh commented 2 years ago

image

image

image

Khandagale-Saurabh commented 2 years ago

image

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

Khandagale-Saurabh commented 2 years ago

image image

Khandagale-Saurabh commented 2 years ago

wire is reactive in nature: once data is avalibel update immediately [$] make it reactive $user.id

image

Decorator: @wire

object adapter:getObjectInfo adapter image

getObjectInfos:-> more than 1 object image

image

Khandagale-Saurabh commented 2 years ago

image

Khandagale-Saurabh commented 2 years ago

image

Khandagale-Saurabh commented 2 years ago

https://blogs.perficient.com/2021/10/20/parent-child-communication-in-lwc/