LWC Getters and Setters | Use Getters and Setters in Lightning Web Components | Basic to Advanced
Вставка
- Опубліковано 6 лис 2020
- Hello Trailblazers, In this video we're going to learn about getters and setters in LWC. We're going to see how we can use the getters and setters in LWC to modify data and add validations.
Pre Requisites:- Setup a local development server in LWC - • Getting Started with L...
Code:- github.com/rahulmalhotra/sale...
Subscribe to SFDC Stop:- ua-cam.com/users/sfdcstop?su...
LWC Todo App Project Tutorial Series - • Simplifying the Callou...
Interested in learning about Scratch Orgs and SFDX ? Have a look at the playlist:- • Getting started with S...
Interested in learning about Integration ? Have a look at this playlist:- • Salesforce Integration...
Again a great tutorial .. 👍 Really helpful.
nice n simple way to explain things
Well explained keep posting new vedios.
all your sessions are really useful whether it is Lightening, Integration, LWC.
Glad you liked them Ramya, Keep Learning!!
Nice tutorial.
Great example -> thank you
Keep Learning!!
Great explanation. Your teaching is amazing. Can you please upload more videos on LWC. You have not uploaded videos recently. Looking forward to seeing more videos
Hi Chithra, Glad you liked the tutorials. I will make a new announcement soon, more videos are on the way!! Stay tuned :)
sir when we can do CRUD operation on button click event or onload event or onchange event then why we need getter and setter?
we can also implement validations in same oncliick function
Good question Ronak. The answer is simple:- Reusability. Sometimes it happens that you're using the same object at multiple places/forms and it can be updated from anywhere. So, getters and setters are the best way to ensure that the validations will be applied no matter where the object is being used.
Hi,
why are you using lightning card inside div tag... both are used to group related information right. Then what is the need of using two tags.
Hi, that's only added to provide a specific defined width to my card which is mentioned in the div.
How can we pass value from parent Aura component to child (get set) variable
Hi srinivas, you can simply create an @api annotated variable in lwc and pass it's value from parent aura component.
If we want to display a property like {Person.FirstName} using getter, what would be the name of the get mehod ?
get firstName()
You can also use get personFirstName() if there are more firstName fields
@@sfdcstop doesn't seem to be working with either :(
name of getter won't return you any data, you need to return the data yourself depending upon what record you're having
@@sfdcstop Specific getter will be called depending on the value attribute yeah? But variable like Person.FirstName can have dot notation, method names can't. So seems getter can't be used without changing variable name.