Activity Forums Salesforce® Discussions Difference between lightning component and lightning web component.

  • Difference between lightning component and lightning web component.

    Posted by Anjali on May 29, 2020 at 1:05 pm

    What is the difference between lightning component and lightning web component in Salesforce?

    Marziya replied 4 years, 6 months ago 3 Members · 2 Replies
  • 2 Replies
  • MOHIT

    Member
    May 29, 2020 at 1:56 pm

    1) When writing a Lightning component, you would use expression syntax {!v.attribute} when wanting to display the value.
    2) When writing a lightning component, to write a condition, you would use the <aura:if> tag.
    3) When writing a lightning component, to iterate over an array, you would use the <aura:iteration> tag
    1) With Lightning web components, we lose the !v. part of the expression and simply add in a standard HTML Expression into the {markup}.
    2) With Lightning web components, this changes to using the if:true and if:false directives to evaluate a condition.
    3) With Lightning web components, this changes to using the for:each and for:item directives to iterate over an array.

  • Marziya

    Member
    May 29, 2020 at 2:33 pm

    The Aura Components and the Lightning Web Components have similar but still different structures. The Aura components have multiple Javascript files while the Lightning Web Components have the only Javascript file, which is also an ES6 Javascript module, as is pointed out in the LWC Building Blocks section.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos