Tuesday 26 March 2019

Create Lightning Web Components - Basic - Key Points

You can learn creating a simple lightning web component from the below trailhead module,

I wanted to highlight the key points from the above modules,
  • You can use if:false and if:true conditional directives within your template to determine which visual elements are rendered. Similar to rendered in the visualforce page or aura:if in the aura components. 
  • Lightning web components use common JavaScript ECMAScript 8 methods and syntax.
  • The JavaScript file for a Lightning web component must include at least this code, where MyComponent is the name you assign your component class.

  1. import { LightningElement } from 'lwc';
  2. export default class MyComponent extends LightningElement {
  3. }

  • The export statement defines a class that extends the LightningElement class. As a best practice, the name of the class usually matches the file name of the JavaScript class, but it’s not a requirement.
  • Decorators are often used in JavaScript to extend the behavior of a class, property, getter, setter, or method.
    • @api: Marks a property as public for use in your template or other components.
    • @track: Marks a property for internal monitoring. A template or function using this property forces a component to rerender when the property’s value changes. Use this to store values locally, especially as a user interacts with your component.
    • @wire: Gives you a way to get and bind data. This implementation simplifies getting data from a Salesforce org
  • But, be aware, apply only one Lightning Web Component decorator to a property at a time. For example, a property can’t have @api (public reactive) and @track (private reactive) decorators at the same time.
  • Respond to any of these lifecycle events using callback methods. For example, the connectedCallback() is invoked when a component is inserted into the DOM. The disconnectedCallback() is invoked when a component is removed from the DOM.

20 comments:

  1. Thanks a lot for sharing that useful information. That was a really Intresting post and I would really like to know more.

    salesforce development company
    Salesforce development services
    Salesforce Consultant

    ReplyDelete
  2. Thanks for sharing your knowledge to help others.

    Very useful Article.

    wordpress customer portal

    ReplyDelete
  3. Appreciating the persistence you put into your blog and detailed information you provide.

    Oracle dba training chennai | oracle dba training course chennai

    ReplyDelete
  4. BA Revaluation Result 2019
    Hey Nice Blog!! Thanks For Sharing!!! Wonderful blog & good post. It is really very helpful to me, waiting for a more new post. Keep Blogging

    ReplyDelete
  5. Thanks for sharing such a nice post with us. Your post is really helpful Top Web Designing Services

    ReplyDelete
  6. Wow ! Amazing information showing through your blog, it's a beautiful decoration things.Thanks for sharing.
    Destech Media

    ReplyDelete
  7. Nice Blog! This blog is very informative for us. Keep it up in future for these kinds of blogs. Thanks for sharing it with us Mobile App Development Services

    ReplyDelete
  8. Amazing post, Contact us for Professional Web Designing Services at affordable prices.

    ReplyDelete
  9. Website is the digital address for your business. Your website should be interesting & appealing and responsive. At Digitalfreelancer360, we offer end-to-end web designing services for organizations as per their needs. Our web designer freelance consultant is highly skilled & experienced in creating the best websites for your business. Contact Us: 8920928177

    ReplyDelete
  10. Thanks for sharing this Informative content. Well explained. Got to learn new things from your Blog.
    Choose ACAP, the top-rated Salesforce development company for small businesses. ACAP’s certified Salesforce developer consultants specialize in customization, migration and integration of award-winning, affordable solutions.

    ReplyDelete
  11. Wow, very informative blog! Post more blogs like this. If you want tailor-made solutions from the dedicated developers that satisfy your budget and expectations, then visit the best Web Development Company in Delhi.

    ReplyDelete
  12. The best casino site on Steam | drmcd
    The best casino site on Steam 남원 출장안마 is at the 영천 출장마사지 best casino 안양 출장샵 site on Steam. There are 사천 출장샵 a variety of games on here and the best experience. 청주 출장마사지 Rating: 4 · ‎6 votes

    ReplyDelete
  13. Being a Web Development Sydney I appreciate the article, This article is very useful for Web Developers. Thanks for sharing such a nice article.



    ReplyDelete
  14. IIS India, a leading web designing company in Delhi, specializes in crafting stunning and functional websites. Our expert team combines creativity and technical expertise to deliver custom web solutions.

    ReplyDelete
  15. IIS India, a leading website designing company in Delhi, transforms visions into stunning online realities. Our expert team crafts user-friendly, responsive websites tailored to your brand, ensuring seamless user experiences.

    ReplyDelete
  16. QUICK EASY EMERGENCY URGENT LOANS LOAN OFFER EVERYONE APPLY NOW +918929509036 financialserviceoffer876@gmail.com Dr. James Eric

    ReplyDelete

Activities: Assign Tasks to a Queue Salesforce Lightning

Salesforce announced to assign Tasks to a Queue beginning from Spring'20 release. How does it work? In Setup, enter Queues in th...