<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: P V Vighnesh</title>
    <description>The latest articles on DEV Community by P V Vighnesh (@pvvighnesh).</description>
    <link>https://dev.to/pvvighnesh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F582706%2F2382fa07-863f-4e3b-a30e-fe16733045aa.jpeg</url>
      <title>DEV Community: P V Vighnesh</title>
      <link>https://dev.to/pvvighnesh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pvvighnesh"/>
    <language>en</language>
    <item>
      <title>Lightning web components - How do components talk?</title>
      <dc:creator>P V Vighnesh</dc:creator>
      <pubDate>Fri, 11 Nov 2022 11:04:04 +0000</pubDate>
      <link>https://dev.to/pvvighnesh/lightning-web-components-how-do-components-talk-1nd3</link>
      <guid>https://dev.to/pvvighnesh/lightning-web-components-how-do-components-talk-1nd3</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Hwg_oeYs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1618550731746/J-QZhe2k7.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Hwg_oeYs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1618550731746/J-QZhe2k7.gif" alt="GIF-Welcome" width="441" height="441"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Welcome Back!
&lt;/h1&gt;

&lt;p&gt;So far in the series, we've seen only one component. In this part, we'll add two separate components and make them talk to each other!&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's start building.
&lt;/h2&gt;

&lt;p&gt;We'll start with creating two new components. I'll call them &lt;em&gt;parentCard&lt;/em&gt; and &lt;em&gt;childCard&lt;/em&gt; because I'll be creating two base card components and the name is easier to remember, but you do you xD.&lt;/p&gt;

&lt;h3&gt;
  
  
  Building Parent-to-Child relationship
&lt;/h3&gt;

&lt;p&gt;Creating Parent-Child relationship between components is as simple as adding a HTML element. &lt;/p&gt;

&lt;p&gt;Below is an example of embedding a Child component in a Parent component. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Miq2j99H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6e9cvz6oktsw8wy5zj4f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Miq2j99H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6e9cvz6oktsw8wy5zj4f.png" alt="Image description" width="531" height="301"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;childCard&lt;/em&gt; is the name of my child component. Two things to note here,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One, the 'c' namespace.
In lwc, child components must be prefixed with 'c' namespace while embedding in a Parent component.&lt;/li&gt;
&lt;li&gt;Two, the component naming convention.
Previously, we've learnt that components must be named in &lt;em&gt;pascalCase&lt;/em&gt;. But when you're embedding a component as a child, we must use &lt;em&gt;kebab-case&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now we have both the components ready, here's what we're going to build to see how the communication works.&lt;/p&gt;

&lt;p&gt;We'll have an input and an output element in both Parent and Child. Whatever we input from Parent, we'll display in child and vice versa. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I'm not adding any code snippets here for building UI here, just so that you can give it a try 😌. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Anyway, here's how my UI looks. Simple enough.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VJzjbZfe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mzbi4tu2b49xar1ligf0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VJzjbZfe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mzbi4tu2b49xar1ligf0.png" alt="Image description" width="633" height="364"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's help our components to develop some communication skills. Speaking of communication skills, let this be a reminder for you (and me) to call up a friend/family and check up on them. Talking to your people is just as important as (probably more) making your components talk! 🌻&lt;/p&gt;

&lt;h4&gt;
  
  
  Another decorator
&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;api&lt;/em&gt; decorator is used to define a public property. This is also reactive. (&lt;a href="https://developer.salesforce.com/docs/component-library/documentation/en/lwc/reference_decorators"&gt;Salesforce docs on decorators&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Before passing the data from Parent, we need to create a variable in Child with &lt;em&gt;api&lt;/em&gt; decorator, so that it can be public and can be accessed from Parent to pass the data.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;api module has to be imported before using it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In the child component, I'm creating a variable called &lt;em&gt;valueFromParent&lt;/em&gt; and displaying it in UI. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qV6dAEO1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v5zm5pcxmi3h7k2blodo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qV6dAEO1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v5zm5pcxmi3h7k2blodo.png" alt="Image description" width="614" height="337"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--frpnMXjI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m1f9c0v9mmdg5nqg31cc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--frpnMXjI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m1f9c0v9mmdg5nqg31cc.png" alt="Image description" width="880" height="168"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the parent component, I'm adding an &lt;em&gt;onchange&lt;/em&gt; event listener on input field to get the value and storing it in &lt;em&gt;inputValue&lt;/em&gt; variable. &lt;/p&gt;

&lt;p&gt;For passing this value to child component, assign the value from parent to the public api property of the child.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fjzBeHR2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xc9kxbhippgdioh4i6vh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fjzBeHR2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xc9kxbhippgdioh4i6vh.png" alt="Image description" width="639" height="188"&gt;&lt;/a&gt;&lt;br&gt;
Here, &lt;em&gt;inputValue&lt;/em&gt; is where I'm storing the value from Parent and passing it on to &lt;em&gt;valueFromParent&lt;/em&gt; api property which we created in child previously. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note the naming convention again. Property which we declared in pascalCase has been converted to kebab-case.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Put that all together, this is what you get. As I'm typing in Parent's input field, the same is displaying on Child.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IAuFxnEi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1c384rzezo61o7gbetkb.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IAuFxnEi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1c384rzezo61o7gbetkb.gif" alt="Image description" width="490" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Building Child-to-Parent relationship
&lt;/h3&gt;

&lt;p&gt;We'll now do the opposite of what we just did. We'll type stuff in Child's input box and send it over to Parent's output field.&lt;br&gt;
Passing the value from Parent-to-Child was as simple as passing a public property, But passing a value from Child to Parent is a bit complicated. I guess we can add that to the list of things common between humans and code 😐.&lt;/p&gt;

&lt;p&gt;Here, we make use of a custom event. We 'throw' the data from the child, and 'catch' it at parent component.&lt;/p&gt;

&lt;p&gt;In the child component, I'll add an &lt;em&gt;onchange&lt;/em&gt; event handler to the input field, and dispatch an event whenever the input value changes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xL-qU1_Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ejbcm9jz4yp3ckfxkh31.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xL-qU1_Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ejbcm9jz4yp3ckfxkh31.png" alt="Image description" width="833" height="188"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yv8dNb8B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1d2gphwgqnjenufze186.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yv8dNb8B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1d2gphwgqnjenufze186.png" alt="Image description" width="630" height="337"&gt;&lt;/a&gt;&lt;br&gt;
Here, every time input changes in Child's input box, we're creating and dispatching an event called &lt;em&gt;childInput&lt;/em&gt;, which includes the data in the &lt;em&gt;detail&lt;/em&gt; property.&lt;/p&gt;

&lt;p&gt;Next, we have to make sure the Parent listens to this event. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---l0RPAii--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0axm3lf9rhwz7a3xcx90.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---l0RPAii--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0axm3lf9rhwz7a3xcx90.png" alt="Image description" width="880" height="185"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;childInput&lt;/em&gt; was out custom event, which I'm handling using &lt;em&gt;handleChildInput&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RX2au2tt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mz1ibrbw29bq0xqytml9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RX2au2tt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mz1ibrbw29bq0xqytml9.png" alt="Image description" width="538" height="289"&gt;&lt;/a&gt;&lt;br&gt;
I'm assigning the value which was sent through &lt;em&gt;detail&lt;/em&gt; property to a variable and displaying it in Parent component.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--59DpxBV0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qlb0tfrmjc5ez1kzw2kr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--59DpxBV0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qlb0tfrmjc5ez1kzw2kr.png" alt="Image description" width="807" height="217"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, if we put all this together, we have Child-to-Parent communication.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tVVmhk6V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ttfv1me0bkpoawf60z1e.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tVVmhk6V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ttfv1me0bkpoawf60z1e.gif" alt="Image description" width="490" height="275"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This was about communication between two components, when they are related to each other. Next up, we'll see how the components communicate if they are not related. (Hint: It has something to do with 'Lightning' and 'Messaging'!)&lt;/p&gt;

&lt;p&gt;If you liked this, follow the series for some more cool stuff on lwc.&lt;br&gt;
Thanks for reading! :D&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3N5ZARjs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/py9z10o523b2ix5jxk7j.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3N5ZARjs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/py9z10o523b2ix5jxk7j.gif" alt="GIF saying see you" width="480" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>salesforce</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Calling a Screen flow from a Vlocity Action</title>
      <dc:creator>P V Vighnesh</dc:creator>
      <pubDate>Sat, 05 Feb 2022 17:58:40 +0000</pubDate>
      <link>https://dev.to/pvvighnesh/calling-a-screen-flow-from-a-vlocity-action-f9f</link>
      <guid>https://dev.to/pvvighnesh/calling-a-screen-flow-from-a-vlocity-action-f9f</guid>
      <description>&lt;p&gt;This post is exactly what the title says. Calling a Screen flow from a Vlocity Action.&lt;/p&gt;

&lt;p&gt;If you're wondering &lt;em&gt;Why do I have to call a Screen flow from a Vlocity Action?&lt;/em&gt;, just know that I didn't know this was even possible, until I had to build it. Even though it's a very simple thing(realizing after building it), I had to spend quite a bit of time figuring it out. &lt;/p&gt;

&lt;p&gt;So if you're reading up to this point, you're either curios or trying to figure out something similar. Either way, let's get into it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build a flow
&lt;/h2&gt;

&lt;p&gt;If you want to call a screen flow, you'd first need a Screen flow to call! 🤷‍♂️&lt;/p&gt;

&lt;p&gt;I'm assuming you already have a flow you want to use. In my case, it was just a simple screen with an input field.&lt;/p&gt;

&lt;p&gt;(Before calling this flow from Vlocity action, it was getting called from Quick action and I made use of the same Quick action)&lt;/p&gt;

&lt;h2&gt;
  
  
  Build a Vlocity Action
&lt;/h2&gt;

&lt;p&gt;If you've ever launched an Omniscript using Vlocity Action, this is very similar.&lt;/p&gt;

&lt;p&gt;Create a new Vlocity Action. Call it whatever you want, but remember the name, you'd need it later. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Link type :&lt;/strong&gt; Other&lt;/p&gt;

&lt;p&gt;Adding a Target URL is where I got confused. If it was an Omniscript, you'd get an URL. How do I get one for a flow?&lt;/p&gt;

&lt;p&gt;After a lot of fiddling around, I decided to use the URL that comes up when we actually launch the flow from the record, with few changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Target URL :&lt;/strong&gt; &lt;code&gt;lightning/action/quick/&amp;lt;&amp;lt;OBJECT.ACTION_NAME&amp;gt;&amp;gt;?objectApiName&amp;amp;Context=RECORD_DETAIL&amp;amp;recordId={0}&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;URL Parameter :&lt;/strong&gt; &lt;code&gt;Id&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here, &lt;code&gt;{0}&lt;/code&gt; is the contextId, meaning it will be replaced by the Id of the record from where this Action is being called.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build a Vlocity card
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Or use already existing one 😅
&lt;/h3&gt;

&lt;p&gt;This is the part where you'd add the Vlocity action you just created to your Card, from where you will be launching the flow.&lt;/p&gt;

&lt;p&gt;Select the card, and add your Action. I told you you'd need the name later.😌&lt;/p&gt;

&lt;p&gt;You might also have to create and add a Vlocity template to your Layout/Card, depending on whether you used existing layout or created a new one. It is better to use the templates from your org to maintain UI consistency. &lt;/p&gt;

&lt;h2&gt;
  
  
  Final steps
&lt;/h2&gt;

&lt;p&gt;Make sure all your changes are present and Activate your card. &lt;/p&gt;

&lt;p&gt;If you've created a new Card/Layout, you'll have to add it to your Flexipage as well.&lt;/p&gt;

&lt;h3&gt;
  
  
  And you've built it!
&lt;/h3&gt;

&lt;p&gt;You can test by clicking on the action and it should launch you straight into the Screen flow.&lt;/p&gt;

&lt;p&gt;Thanks for reading. I post stuff on Salesforce, LWC, Vlocity, Frontend development and Design(or at least I wish to). &lt;br&gt;
You can check out my ongoing LWC series &lt;a href="https://dev.to/pvvighnesh/lightning-web-components-introduction-1o0p"&gt;here&lt;/a&gt;, and if you like the content, do hit the Follow button! &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xz2ArJXz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rsbudmvrsu9bs91h0oo8.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xz2ArJXz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rsbudmvrsu9bs91h0oo8.gif" alt="Peace out gif" width="200" height="212"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>salesforce</category>
      <category>vlocity</category>
    </item>
    <item>
      <title>Lightning web components - Rendering Lists</title>
      <dc:creator>P V Vighnesh</dc:creator>
      <pubDate>Thu, 15 Apr 2021 16:44:44 +0000</pubDate>
      <link>https://dev.to/pvvighnesh/lightning-web-components-rendering-lists-1ge7</link>
      <guid>https://dev.to/pvvighnesh/lightning-web-components-rendering-lists-1ge7</guid>
      <description>&lt;h3&gt;
  
  
  Welcome back!
&lt;/h3&gt;

&lt;p&gt;This is the continuation of the previous blog &lt;a href="https://dev.to/pvvighnesh/lightning-web-components-conditional-rendering-728"&gt;Lightning web components - Conditional Rendering&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In the last part, we built a new component &lt;em&gt;employeeDetails&lt;/em&gt;, saw how 'formatted' tags work and conditionally rendered the details section. We'll see how we can render lists in this part.&lt;/p&gt;

&lt;p&gt;There are two ways we can do this in LWC. We can either use for:each directive or the iterator directive to iterate over an array. Add the directive to a nested  tag that encloses the HTML elements you want to repeat.&lt;/p&gt;

&lt;p&gt;The iterator directory has special properties, &lt;em&gt;first&lt;/em&gt; and &lt;em&gt;last&lt;/em&gt;  that let you apply special behaviors to the first and last items in an array.&lt;/p&gt;

&lt;p&gt;Regardless of which directive you use, you must use a key directive to assign a unique ID to each item. When a list changes, the framework uses the key to rerender only the item that changed.&lt;/p&gt;

&lt;h3&gt;
  
  
  for:each
&lt;/h3&gt;

&lt;p&gt;When using the for:each directive, use for:item to access the current item. &lt;br&gt;
To assign a key to the first element in the nested template, use the key={uniqueId} directive.&lt;/p&gt;
&lt;h3&gt;
  
  
  Iterator
&lt;/h3&gt;

&lt;p&gt;To apply special behaviour to the first or last item in a list, use the iterator directive, iterator:iteratorName={array}. Use the iterator directive on a template tag.&lt;/p&gt;
&lt;h3&gt;
  
  
  Let's build something!
&lt;/h3&gt;

&lt;p&gt;We can use our old &lt;em&gt;simpleCalculator&lt;/em&gt; component to play around with for:each and iterator. We'll add two more buttons to the UI to show the previous calculation history and to clear the history.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    &amp;lt;lightning-card title="Simple Calculator" icon-name="utility:advanced_function" class="slds-text-align_center"&amp;gt;
        &amp;lt;div class="slds-p-around_medium"&amp;gt;
            &amp;lt;lightning-input type="number" name="firstNum" value={firstNumber} placeholder="First Number" onchange={handleFirstNum}&amp;gt;&amp;lt;/lightning-input&amp;gt;
            &amp;lt;lightning-input type="number" name="secondNum" value={secondNumber} placeholder="Second Number" onchange={handleSecondNum}&amp;gt;&amp;lt;/lightning-input&amp;gt;
            &amp;lt;lightning-input type="text" name="result" value={result} placeholder="Result" readonly&amp;gt;&amp;lt;/lightning-input&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;div class="slds-grid slds-p-around_medium"&amp;gt;
            &amp;lt;lightning-button label="Add" icon-name="utility:add" size="small" onclick={handleAdd} class="slds-col"&amp;gt;&amp;lt;/lightning-button&amp;gt;
            &amp;lt;lightning-button label="Subtract" icon-name="utility:dash" size="small" onclick={handleSub} class="slds-col"&amp;gt;&amp;lt;/lightning-button&amp;gt;
            &amp;lt;lightning-button label="Multiply" icon-name="utility:close" size="small" onclick={handleMul} class="slds-col"&amp;gt;&amp;lt;/lightning-button&amp;gt;
            &amp;lt;lightning-button label="Divide" icon-name="utility:percent" size="small" onclick={handleDiv} class="slds-col"&amp;gt;&amp;lt;/lightning-button&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;div class="slds-grid slds-p-around_medium"&amp;gt;
            &amp;lt;lightning-button class="slds-col" variant="brand" label="Clear" onclick={handleclear} &amp;gt;&amp;lt;/lightning-button&amp;gt;
            &amp;lt;lightning-button-stateful class="slds-col" label-when-off="Show History" label-when-on="Hide History" variant="brand"  selected={isSelected} onclick={handleClick}&amp;gt;&amp;lt;/lightning-button-stateful&amp;gt;
            &amp;lt;lightning-button class="slds-col" label="Clear History" variant="brand" onclick={handleClearHistory}&amp;gt;&amp;lt;/lightning-button&amp;gt;
        &amp;lt;/div&amp;gt; 
           &amp;lt;template if:true={isSelected}&amp;gt; 
            &amp;lt;div class="slds-text-align_center"&amp;gt;Previous Calculations
                {historyData}
            &amp;lt;/div&amp;gt;
        &amp;lt;/template&amp;gt;
    &amp;lt;/lightning-card&amp;gt; 
&amp;lt;/template&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, this should make our UI look like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1618223273350%2FD8UOLDlZN.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1618223273350%2FD8UOLDlZN.png" alt="UI Changes"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We'll modify the JavaScript file to handle the two buttons we added to the HTML.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { LightningElement } from 'lwc';

export default class SimpleCalculator extends LightningElement {
    firstNumber;
    secondNumber;
    result;
    isSelected = false;
    historyData = [];
    id;

    handleFirstNum(event) {
        this.firstNumber = event.target.value;
    }

    handleSecondNum(event) {
        this.secondNumber = event.target.value;
    }

    handleAdd() {
        this.result = `The result of ${this.firstNumber} + ${this.secondNumber} is: ${parseFloat(this.firstNumber) + parseFloat(this.secondNumber)}`;
        this.historyData.push(this.result);
    }

    handleSub() {
        this.result = `The result of ${this.firstNumber} - ${this.secondNumber} is: ${parseFloat(this.firstNumber) - parseFloat(this.secondNumber)}`;
        this.historyData.push(this.result);
    }

    handleMul() {
        this.result = `The result of ${this.firstNumber} * ${this.secondNumber} is: ${parseFloat(this.firstNumber) * parseFloat(this.secondNumber)}`;
        this.historyData.push(this.result);
    }

    handleDiv() {
        if(this.secondNumber &amp;gt; 0) {
            this.result = `The result of ${this.firstNumber} / ${this.secondNumber} is: ${parseFloat(this.firstNumber) / parseFloat(this.secondNumber)}`;
        }
        else {
            this.result = "Invalid Input";
        }
        this.historyData.push(this.result);

    }

    handleclear() {
        this.firstNumber = '';
        this.secondNumber = '';
        this.result = '';
    }

    handleClick() {
        this.isSelected = !this.isSelected;
        showHistory(this.isSelected);
    }

    showHistory(isSelected) {
        if(isSelected) {
            this.showHistoryData = true;
        }
    }
    handleClearHistory() {
        this.historyData = [];
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1618225022889%2FvXYxA_kpG.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1618225022889%2FvXYxA_kpG.gif" alt="out1.gif"&gt;&lt;/a&gt;&lt;br&gt;
This is how it looks. &lt;/p&gt;

&lt;p&gt;Now, let's try the same with for:each directive. Modify the nested &lt;code&gt;&amp;lt;template&amp;gt;&lt;/code&gt; tag in the HTML.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; &amp;lt;template if:true={isSelected}&amp;gt; 
        &amp;lt;div class="slds-text-align_center"&amp;gt;Previous Calculations
              &amp;lt;ul class="slds-m-around_medium"&amp;gt;
                    &amp;lt;template for:each={historyData} for:item="res"&amp;gt;
                          &amp;lt;li key={res}&amp;gt;
                            {res}
                          &amp;lt;/li&amp;gt;
                   &amp;lt;/template&amp;gt;
             &amp;lt;/ul&amp;gt;
        &amp;lt;/div&amp;gt;
 &amp;lt;/template&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The lines are coming one after the other, instead of on the same line.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1618226625504%2FhpaMcQ2nw.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1618226625504%2FhpaMcQ2nw.gif" alt="Output of the component using for:each"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's try the same using the Iterator.&lt;br&gt;
Modify the nested template tag again to add the Iterator.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template if:true={isSelected}&amp;gt; 
            &amp;lt;div class="slds-text-align_center"&amp;gt;Previous Calculations
                 &amp;lt;ul&amp;gt;
                    &amp;lt;template iterator:res={historyData}&amp;gt;
                        &amp;lt;li key={res.value}&amp;gt;
                            &amp;lt;div if:true={res.first} class="slds-border_top background"&amp;gt;&amp;lt;/div&amp;gt;
                            {res.value}
                            &amp;lt;div if:true={res.last} class="slds-border_bottom background"&amp;gt;&amp;lt;/div&amp;gt;
                        &amp;lt;/li&amp;gt;
                    &amp;lt;/template&amp;gt;
                &amp;lt;/ul&amp;gt;
            &amp;lt;/div&amp;gt;
        &amp;lt;/template&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice how we are able to use &lt;em&gt;first&lt;/em&gt; and &lt;em&gt;last&lt;/em&gt; properties? That's something only Iterator offers. Let's see out it looks now.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1618227287848%2F8U7qlw-EN.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1618227287848%2F8U7qlw-EN.gif" alt="Output of the component after using Iterator"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's not much of a difference but using &lt;em&gt;first&lt;/em&gt; and &lt;em&gt;last&lt;/em&gt; properties, we managed to add a border at the top and at the bottom. Along with that, all the other buttons we added are working fine. &lt;/p&gt;

&lt;p&gt;We had previously built the &lt;em&gt;simpleCalculator&lt;/em&gt; component that could do basic Arithmetic operations and a button to clear out the values. In this part, we enhanced that application by adding a button to reveal Previous data conditionally and also a button to clear out the history. We also saw how to implement both using &lt;em&gt;for:each&lt;/em&gt; and &lt;em&gt;Iterative&lt;/em&gt; directives. &lt;/p&gt;

&lt;p&gt;In the next part, we will see how to create Child and Parent component and how to pass data between them.&lt;/p&gt;

&lt;p&gt;If you liked this, follow the series for some more cool stuff on lwc. &lt;br&gt;
Thanks for reading! :D&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Lightning web components - Conditional Rendering</title>
      <dc:creator>P V Vighnesh</dc:creator>
      <pubDate>Wed, 14 Apr 2021 07:11:43 +0000</pubDate>
      <link>https://dev.to/pvvighnesh/lightning-web-components-conditional-rendering-728</link>
      <guid>https://dev.to/pvvighnesh/lightning-web-components-conditional-rendering-728</guid>
      <description>&lt;h3&gt;
  
  
  Good to have you back!
&lt;/h3&gt;

&lt;p&gt;This is the continuation of the previous blog &lt;a href="https://dev.to/pvvighnesh/lightning-web-components-more-javascript-24bn"&gt;Lightning web components - More JavaScript!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the previous part, we played around with JavaScript and built a Simple Calculator component. In this blog, we will see how we can conditionally render DOM elements.&lt;/p&gt;

&lt;p&gt;Let's build a new component. We'll just add a couple of elements to take input from the user, and then we'll make use of conditional rendering to display the data on click of a button.&lt;/p&gt;

&lt;h4&gt;
  
  
  Let's get the UI rolling.
&lt;/h4&gt;

&lt;p&gt;Let's call our best friend Command Pallate and create a new Lightning Component. I'll name the component &lt;em&gt;employeeDetails&lt;/em&gt;, but again, you do you. And also, don't forget to name your component in camelCase. Very important.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
    &amp;lt;lightning-card title="Employee Details" class="slds-text-align_center"&amp;gt;
        &amp;lt;div class="slds-p-around_medium"&amp;gt;
            &amp;lt;lightning-input type="text" placeholder="Name" onchange={handleName}&amp;gt;&amp;lt;/lightning-input&amp;gt;
            &amp;lt;lightning-input type="number" placeholder="Phone Number" onchange={handlePhone}&amp;gt;&amp;lt;/lightning-input&amp;gt;
            &amp;lt;lightning-input type="email"  placeholder="Email address" onchange={handleMail}&amp;gt;&amp;lt;/lightning-input&amp;gt;
            &amp;lt;lightning-input type="number" name="ctc" placeholder="Expected CTC" onchange={handleCtc}&amp;gt;&amp;lt;/lightning-input&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;div class="slds-grid slds-p-around_medium"&amp;gt;
           &amp;lt;lightning-button class="slds-col" variant="brand" label="Show Details" onclick={handleClick}&amp;gt;&amp;lt;/lightning-button&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/lightning-card&amp;gt;
&amp;lt;/template&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Modify the HTML file, deploy the code to org and you should be able to see something like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617974728714%2F_aWDcKtFJ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617974728714%2F_aWDcKtFJ.png" alt="UI of EmployeeDetails"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  JavaScript!
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { LightningElement } from 'lwc';

export default class EmployeeDetails extends LightningElement {
    name;
    phone;
    mail;
    ctc;

    handleName(event) {
        this.name = event.target.value;
    }
    handlePhone(event) {
        this.phone = event.target.value;
    }
    handleMail(event) {
        this.mail = event.target.value;
    }
    handleCtc(event) {
        this.ctc = event.target.value;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We added the elements in the UI and added methods to handle the input. &lt;/p&gt;

&lt;h4&gt;
  
  
  Now let's check how to render them with the click of the button.
&lt;/h4&gt;

&lt;p&gt;To render HTML conditionally, add the &lt;em&gt;if:true|false&lt;/em&gt; directive to a nested  tag that encloses the conditional content. The &lt;em&gt;if:true|false={property}&lt;/em&gt; directive binds data to the template and removes and inserts DOM elements based on whether the data is a &lt;a href="https://developer.mozilla.org/en-US/docs/Glossary/Truthy" rel="noopener noreferrer"&gt;truthy or falsy&lt;/a&gt; value.&lt;/p&gt;

&lt;p&gt;Let's modify our HTML file. Add this after closing the &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; tag of the button.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template if:true={isSelected}&amp;gt;
            &amp;lt;div class="slds-text-align_center"&amp;gt; 
                &amp;lt;div class="slds-text-heading_medium"&amp;gt;Employee Details&amp;lt;/div&amp;gt;&amp;lt;br/&amp;gt;
                &amp;lt;lightning-formatted-text value={name} &amp;gt;&amp;lt;/lightning-formatted-text&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;
                &amp;lt;lightning-formatted-phone value={phone} &amp;gt;&amp;lt;/lightning-formatted-phone&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;
                &amp;lt;lightning-formatted-email value={mail}&amp;gt;&amp;lt;/lightning-formatted-email&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;
                &amp;lt;lightning-formatted-number value={ctc} format-style="currency" currency-code="EUR" &amp;gt;&amp;lt;/lightning-formatted-number&amp;gt;
            &amp;lt;/div&amp;gt;
        &amp;lt;/template&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We'll add one more variable &lt;em&gt;isSelected&lt;/em&gt; and add a method to handle the click.&lt;/p&gt;

&lt;p&gt;Modify the JavaScript file to add these changes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   isSelected = false;

    handleClick() {
    this.isSelected = true;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Did you notice how we have used &lt;code&gt;&amp;lt;lightning-formatted-text&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;lightning-formatted-email&amp;gt;&lt;/code&gt; etc, in our template? You can read more about them &lt;a href="https://developer.salesforce.com/docs/component-library/bundle/lightning-formatted-text/example" rel="noopener noreferrer"&gt;here&lt;/a&gt;. If you're too lazy to click, those tags format the data in a certain way. We'll see that in our component.&lt;/p&gt;

&lt;p&gt;Let's deploy our code and see how it looks.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617981378918%2FODvAG9QvO.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617981378918%2FODvAG9QvO.gif" alt="Component after adding conditional rendering"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It works!&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617987396174%2F9YkkjEtvZ.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617987396174%2F9YkkjEtvZ.gif" alt="Happy dance.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Notice how it's displaying E-mail, Phone number and Currency. That's the magic of the 'formatted' tags.&lt;/p&gt;
&lt;h4&gt;
  
  
  Let's enhance the button.
&lt;/h4&gt;

&lt;p&gt;There is something called the &lt;code&gt;Stateful button&lt;/code&gt;.  A &lt;code&gt;lightning-button-stateful&lt;/code&gt; component represents a button that toggles between states, similar to a Like button on social media. Stateful buttons can show a different label and icon based on their selected states. &lt;/p&gt;

&lt;p&gt;Let's modify the HTML file and use a stateful button instead of normal buttons. &lt;/p&gt;

&lt;p&gt;Replace the previous button tag with this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;lightning-button-stateful class="slds-col" label-when-off="Show Details" label-when-on="Hide Details" variant="brand"  selected={isSelected} onclick={handleClick}&amp;gt;&amp;lt;/lightning-button-stateful&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's modify the JavaScript to handle this. Replace the old &lt;code&gt;handleClick()&lt;/code&gt; method with this one and add another method &lt;code&gt;showDetails()&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;handleClick() {
        this.isSelected = !this.isSelected;
        showDetails(this.isSelected);
    }
    showDetails(isSelected) {
        if(isSelected) {
            this.isShown = true;
        }
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save and deploy. Let's see the changes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617987014224%2FGFVfgPHRgN.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617987014224%2FGFVfgPHRgN.gif" alt="Component after adding stateful buttons"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;See what's happening there? It's not just conditionally rendering, but also the label of the button is changing every time we click. Tell me that isn't cool! xD&lt;/p&gt;

&lt;p&gt;Well, that's it for this part. We created a new component that takes input from the user, we added a button to conditionally display the data. We also explored the 'formatted' tags and 'stateful button'. &lt;br&gt;
In the next one, we'll see how to use an iterator and for each. &lt;/p&gt;

&lt;p&gt;If you liked this, follow the series for some more cool stuff on lwc. There will be one post every day. &lt;/p&gt;

&lt;p&gt;Thanks for reading! :D&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Lightning web components - More JavaScript!</title>
      <dc:creator>P V Vighnesh</dc:creator>
      <pubDate>Tue, 13 Apr 2021 12:58:24 +0000</pubDate>
      <link>https://dev.to/pvvighnesh/lightning-web-components-more-javascript-24bn</link>
      <guid>https://dev.to/pvvighnesh/lightning-web-components-more-javascript-24bn</guid>
      <description>&lt;h3&gt;
  
  
  Welcome back!
&lt;/h3&gt;

&lt;p&gt;This is the continuation of the previous blog &lt;a href="https://dev.to/pvvighnesh/lightning-web-components-adding-styles-and-javascript-4h2f"&gt;Lightning Web Components - Adding Styles and JavaScript&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In the last part, we made our component look a bit better and added some JavaScript too. &lt;/p&gt;

&lt;p&gt;In this part, we'll tinker around with some more JavaScript by building another simple component. We'll build a Calculator, that takes in 2 inputs, and lets us perform some basic arithmetic operation and displays the result.&lt;/p&gt;

&lt;h3&gt;
  
  
  Let's get building
&lt;/h3&gt;

&lt;p&gt;Fire up your VSCode. Call our best friend Command Palette and type in the command to create a new lwc.&lt;/p&gt;

&lt;p&gt;Alternatively, you can right-click on 'lwc' folder in file explorer in VScode and select the &lt;em&gt;Create Lightning Web Components&lt;/em&gt; command.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617863692887%2FqqNHdc_pO.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617863692887%2FqqNHdc_pO.png" alt="Another way of creating lwc"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's name our component now and since I mentioned it's going to be a simple one, I'll name it &lt;strong&gt;simpleCalculator&lt;/strong&gt;. I know, very Creative.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617864697294%2F0HAjNRbwI.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617864697294%2F0HAjNRbwI.png" alt="Meme on creativity"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will follow the same step as &lt;a href="https://pv-vighnesh.hashnode.dev/lwc-adding-styles-and-javascript" rel="noopener noreferrer"&gt;before&lt;/a&gt;. Let's add a card first as a container to hold our two input elements, we'll also add another element to display the output. Since we already know how to play around with the &lt;em&gt;slds&lt;/em&gt;, we'll throw that into the mix as well.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
    &amp;lt;lightning-card title="Simple Calculator" icon-name="utility:advanced_function" class="slds-text-align_center"&amp;gt;
        &amp;lt;div class="slds-p-around_medium"&amp;gt;
            &amp;lt;lightning-input type="number" name="firstNum" value={firstNumber} placeholder="First Number" onchange={handleFirstNum}&amp;gt;&amp;lt;/lightning-input&amp;gt;
            &amp;lt;lightning-input type="number" name="secondNum" value={secondNumber} placeholder="Second Number" onchange={handleSecondNum}&amp;gt;&amp;lt;/lightning-input&amp;gt;
            &amp;lt;lightning-input type="text" name="result" value={result} placeholder="Result" readonly&amp;gt;&amp;lt;/lightning-input&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/lightning-card&amp;gt; 
&amp;lt;/template&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After we save and deploy this to our org, we should be able to see something like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617865449071%2FXWHLjOXs3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617865449071%2FXWHLjOXs3.png" alt="Component after adding i/p and result fields"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, let's add buttons to perform the math. We'll give the user the option to Add, Subtract, Multiply or Divide two numbers. &lt;/p&gt;

&lt;p&gt;After ending the &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; tag previously, we'll add another one to hold our buttons.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        &amp;lt;div class="slds-grid slds-p-around_medium"&amp;gt;
            &amp;lt;lightning-button label="Add" icon-name="utility:add" size="small" onclick={handleAdd} class="slds-col"&amp;gt;&amp;lt;/lightning-button&amp;gt;
            &amp;lt;lightning-button label="Subtract" icon-name="utility:dash" size="small" onclick={handleSub} class="slds-col"&amp;gt;&amp;lt;/lightning-button&amp;gt;
            &amp;lt;lightning-button label="Multiply" icon-name="utility:close" size="small" onclick={handleMul} class="slds-col"&amp;gt;&amp;lt;/lightning-button&amp;gt;
            &amp;lt;lightning-button label="Divide" icon-name="utility:percent" size="small" onclick={handleDiv} class="slds-col"&amp;gt;&amp;lt;/lightning-button&amp;gt;
        &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also, did you notice we're using &lt;em&gt;grid&lt;/em&gt;? You can read more about how we use grid in lwc &lt;a href="https://www.lightningdesignsystem.com/utilities/grid/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This should make our component look like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617865886468%2FJcRVXuBLG.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617865886468%2FJcRVXuBLG.png" alt="Component after adding buttons"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  The UI looks good now, let's get down to JavaScript and make this thing work.
&lt;/h4&gt;

&lt;p&gt;First, we need to declare our variables. Speaking of variables now is the time to talk about decorators. &lt;/p&gt;

&lt;p&gt;The Lightning Web Components model has 3 decorators and these three decorators are unique to LWC.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;'@api' - Public properties are reactive. If the value of public property changes, the component re-renders.  To expose a public property or a method, decorate it with @api. &lt;/li&gt;
&lt;li&gt;'@track' - Fields are reactive. If a field’s value changes and the field is used in a template or in a getter of a property that’s used in a template, the component rerenders and displays the new value.&lt;/li&gt;
&lt;li&gt;'@wire' - To read Salesforce data, Lightning web components use a reactive wire service. When the wire service provisions data, the component re-renders.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can learn more about them &lt;a href="https://developer.salesforce.com/docs/component-library/documentation/en/lwc/reference_decorators" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Let's get back to declaring variables. We'd usually declare with '@track' decorator but with the new version, we don't have to. Unless we specify a different decorator, any variable we declare will default to track decorator.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { LightningElement } from 'lwc';

export default class SimpleCalculator extends LightningElement {
    firstNumber;
    secondNumber;
    result;

handleFirstNum(event) {
        this.firstNumber = event.target.value;
    }

    handleSecondNum(event) {
        this.secondNumber = event.target.value;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We have declared variables and added two methods to handle two inputs.&lt;/p&gt;

&lt;p&gt;Let's add a method to handle the addition operation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;handleAdd() {
        this.result = `The result of ${this.firstNumber} + ${this.secondNumber} is: ${parseFloat(this.firstNumber) + parseFloat(this.secondNumber)}`;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617867976015%2FXvBpXmZqp.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617867976015%2FXvBpXmZqp.gif" alt="GIF of Addition operation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So this works. Phew. &lt;br&gt;
Let's do the same thing for the other three operations as well.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;handleSub() {
        this.result = `The result of ${this.firstNumber} - ${this.secondNumber} is: ${parseFloat(this.firstNumber) - parseFloat(this.secondNumber)}`;
    }

    handleMul() {
        this.result = `The result of ${this.firstNumber} * ${this.secondNumber} is: ${parseFloat(this.firstNumber) * parseFloat(this.secondNumber)}`;
    }

    handleDiv() {
        if(this.secondNumber &amp;gt; 0) {
            this.result = `The result of ${this.firstNumber} / ${this.secondNumber} is: ${parseFloat(this.firstNumber) / parseFloat(this.secondNumber)}`;
        }
        else {
            this.result = "Invalid Input";
        }   
    }

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's see if this works. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617868545321%2FVg2nzL5dni.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617868545321%2FVg2nzL5dni.gif" alt="Final output"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And it does work.&lt;/p&gt;

&lt;p&gt;Let's add one more functionality before we end this blog. We will build a &lt;em&gt;Clear&lt;/em&gt; button that will, obviously, clear out all the values. &lt;/p&gt;

&lt;p&gt;Let's start by adding one more button to our UI. I've also introduced a new attribute called &lt;em&gt;variant&lt;/em&gt; to the button element and assigned the value of 'brand' to it. Let's see what difference that makes to the button.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="slds-grid slds-p-around_medium"&amp;gt;
   &amp;lt;lightning-button class="slds-col" variant="brand" label="Clear" onclick={handleclear} &amp;gt;&amp;lt;/lightning-button&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's also add a method to handle the Clear button.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;handleclear() {
        this.firstNumber = '';
        this.secondNumber = '';
        this.result = '';
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will clear all the values when we press the &lt;em&gt;Clear button&lt;/em&gt;. Or, will it? &lt;br&gt;
Let's deploy our new changes to the org and see the changes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617872230272%2FD0v6OWwpm.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617872230272%2FD0v6OWwpm.gif" alt="GIF of the component after adding clear button"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Noticed how the variant attribute changed the button? You can read more about it in the &lt;a href="https://developer.salesforce.com/docs/component-library/overview/components" rel="noopener noreferrer"&gt;Components Library&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To sum up this part, we built a UI for our &lt;strong&gt;Simple Calculator&lt;/strong&gt; component using a Card, a couple of input fields and buttons. Then we played around with JavaScript to make our component work as expected. &lt;/p&gt;

&lt;p&gt;In the next part, we will learn how to conditionally render elements and a little bit about the arrays.&lt;/p&gt;

&lt;p&gt;If you liked this, keep an eye on this series.&lt;br&gt;
Thanks for stopping by. :D&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>Lightning Web Components - Adding Styles and JavaScript</title>
      <dc:creator>P V Vighnesh</dc:creator>
      <pubDate>Mon, 12 Apr 2021 06:23:10 +0000</pubDate>
      <link>https://dev.to/pvvighnesh/lightning-web-components-adding-styles-and-javascript-4h2f</link>
      <guid>https://dev.to/pvvighnesh/lightning-web-components-adding-styles-and-javascript-4h2f</guid>
      <description>&lt;h3&gt;
  
  
  Welcome back!
&lt;/h3&gt;

&lt;p&gt;This is the continuation of the previous blog &lt;a href="https://dev.to/pvvighnesh/lightning-web-components-introduction-1o0p"&gt;Lightning Web Components - Introduction&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Previously, we learnt how to prep our Org, set up our VSCode and finally we deployed our first component. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617770808339%2FY6E8jRDoF.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617770808339%2FY6E8jRDoF.png" alt="Screenshot of the first component"&gt;&lt;/a&gt;&lt;br&gt;
Now we'll make it look better and add some JavaScript. &lt;/p&gt;

&lt;p&gt;Let's build a better UI. Before we do that, bookmark the below links. It'll come in handy later, Trust me.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://developer.salesforce.com/docs/component-library/overview/components" rel="noopener noreferrer"&gt;Components Library&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.lightningdesignsystem.com/icons/" rel="noopener noreferrer"&gt;Icons Library&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you noticed in the previous screenshot, every other component apart from ours has a nice white background. Let's start with adding that.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
    &amp;lt;lightning-card&amp;gt;
    &amp;lt;p&amp;gt;Hello. This is my first LWC.&amp;lt;/p&amp;gt;
    &amp;lt;/lightning-card&amp;gt;
&amp;lt;/template&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This adds a lightning card element and our UI will look like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617771742831%2F6MSleXhFZ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617771742831%2F6MSleXhFZ.png" alt="Screenshot after adding Lightning card"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now is the perfect time to talk about SLDS. &lt;/p&gt;

&lt;p&gt;SLDS is &lt;strong&gt;Salesforce Lightning Design System&lt;/strong&gt;. It is a CSS framework that gives you access to the icons, colour palettes, and fonts and helps you build applications with the look and feel of Lightning Experience without writing a single line of CSS.&lt;/p&gt;

&lt;p&gt;You can read more about it &lt;a href="https://www.lightningdesignsystem.com/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you refer to the &lt;a href="https://developer.salesforce.com/docs/component-library/bundle/lightning-card/documentation" rel="noopener noreferrer"&gt;Component Library&lt;/a&gt; for the lightning card, you will also see that we can add title and icon to the card.&lt;/p&gt;

&lt;p&gt;We can try this out. Modify the HTML as below to add a title and an icon to our card and some margin and padding to our text. &lt;/p&gt;

&lt;p&gt;Also, notice the way we write &lt;em&gt;slds&lt;/em&gt; styles. That's the syntax we should follow.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
    &amp;lt;lightning-card title="First Component" icon-name="utility:fallback"&amp;gt;
        &amp;lt;div class="slds-m-top_small slds-p-left_small"&amp;gt;
            &amp;lt;p&amp;gt;Hello. This is my first LWC.&amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/lightning-card&amp;gt;
&amp;lt;/template&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Adding these changes and deploying the code will make our component look like this. A bit better now, isn't it?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617772753801%2Fv5hTRbc5D.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617772753801%2Fv5hTRbc5D.png" alt="Component after additional styling"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's go a step further. Instead of just saying 'Hello' there, we'll try to make it display any string that we enter. &lt;/p&gt;

&lt;p&gt;For example, if I enter 'Vighnesh' as an input, it should display 'Hello Vighnesh'. &lt;/p&gt;

&lt;p&gt;And yes, we'll finally add some JavaScript now.&lt;/p&gt;

&lt;p&gt;First, we need a way to take input from the user. Let's modify our HTML to get that done.&lt;/p&gt;

&lt;p&gt;We'll use the &lt;code&gt;&amp;lt;lightning-input&amp;gt;&lt;/code&gt; tag to get input from the user. Our HTML will look like this after making changes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
    &amp;lt;lightning-card title="First Component" icon-name="utility:fallback"&amp;gt;
        &amp;lt;div class="slds-m-top_small slds-p-around_small"&amp;gt;
            &amp;lt;p&amp;gt;Hello {userName}. This is my first LWC.&amp;lt;/p&amp;gt;
            &amp;lt;lightning-input type="text" value={userName} onchange={handleOnChange}&amp;gt;&amp;lt;/lightning-input&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/lightning-card&amp;gt;
&amp;lt;/template&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;JavaScript file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { LightningElement } from 'lwc';

export default class Hello extends LightningElement {
    userName = 'World';

    handleOnChange(event) {
        this.userName = event.target.value;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the files. Deploy it to your org. Check the output.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617774508727%2FB-U9T2wUu.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617774508727%2FB-U9T2wUu.gif" alt="GIF of final output"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; You might have to open the app builder and save it every time you deploy some changes. (You can open the app builder by clicking on the &lt;strong&gt;Edit Page&lt;/strong&gt; option in setup cog)&lt;/p&gt;

&lt;p&gt;And that is it for the blog. In the next part, we will explore a bit more around the same concepts and build another simple application.&lt;/p&gt;

&lt;p&gt;If you liked this, keep an eye on this series.&lt;/p&gt;

&lt;p&gt;Thanks for reading. :3&lt;/p&gt;

</description>
      <category>salesforce</category>
      <category>javascript</category>
      <category>lwc</category>
    </item>
    <item>
      <title>Lightning Web Components - Introduction</title>
      <dc:creator>P V Vighnesh</dc:creator>
      <pubDate>Thu, 08 Apr 2021 05:39:00 +0000</pubDate>
      <link>https://dev.to/pvvighnesh/lightning-web-components-introduction-1o0p</link>
      <guid>https://dev.to/pvvighnesh/lightning-web-components-introduction-1o0p</guid>
      <description>&lt;h3&gt;
  
  
  So what are Lightning web components?
&lt;/h3&gt;

&lt;p&gt;Lightning web components are custom elements built using HTML and modern JavaScript. It's a new breed of lightweight framework built on web standards.&lt;/p&gt;

&lt;h3&gt;
  
  
  What do you need to get started?
&lt;/h3&gt;

&lt;p&gt;If you're very eager or... lazy to set up things right away, then you can check out &lt;a href="https://webcomponents.dev/create/lwc" rel="noopener noreferrer"&gt;this.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have some time, then you can follow the steps below to set things up.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;First things first, you will need an org. An org is where you do stuff. You can get one for free &lt;a href="https://developer.salesforce.com/signup" rel="noopener noreferrer"&gt;here.&lt;/a&gt;. If you have a &lt;a href="https://trailhead.salesforce.com/" rel="noopener noreferrer"&gt;trailhead&lt;/a&gt; account, you can use your Playground as well.&lt;/li&gt;
&lt;li&gt;You have to set up &lt;em&gt;My Domain&lt;/em&gt; for your org. &lt;a href="https://help.salesforce.com/articleView?id=sf.domain_name_setup.htm&amp;amp;type=5" rel="noopener noreferrer"&gt;Click here&lt;/a&gt; to see how to do it. If you're using Trailhead playground, you can skip this because it will have its &lt;em&gt;My Domain&lt;/em&gt; configured. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To Enable &lt;em&gt;Dev Hub&lt;/em&gt;, you can follow &lt;a href="https://help.salesforce.com/articleView?id=sf.sfdx_setup_enable_devhub.htm&amp;amp;type=5" rel="noopener noreferrer"&gt;this link&lt;/a&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Once you have your Org ready, install &lt;a href="https://developer.salesforce.com/tools/sfdxcli" rel="noopener noreferrer"&gt;Salesforce CLI&lt;/a&gt; and &lt;a href="https://code.visualstudio.com/" rel="noopener noreferrer"&gt;VS Code&lt;/a&gt;.
You can check if it's installed correctly or not by typing &lt;em&gt;sfdx&lt;/em&gt; in the terminal. If everything is good, you'll see something like this.
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617647628358%2F0M2aVAfxv.png" alt="Image showing output for sfdx command"&gt;
&lt;/li&gt;
&lt;li&gt;In the VS Code, download &lt;a href="https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode" rel="noopener noreferrer"&gt;Salesforce Extension pack&lt;/a&gt; extension.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, if you open your Command Palette by pressing Ctrl+Shift+P (Windows) or Cmd+Shift+P (macOS) and type in &lt;em&gt;sfdx&lt;/em&gt;, you should be able to see these commands. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617647987130%2FougACQA9g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617647987130%2FougACQA9g.png" alt="Photo of sfdx commands"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Congratulations! You're one step closer to build your first lwc.
&lt;/h3&gt;

&lt;p&gt;Let's get down to business now. Let's build our component and you guessed it, it's going to be a &lt;strong&gt;Hello World&lt;/strong&gt; component.&lt;/p&gt;

&lt;p&gt;Open the Command Palette and type &lt;em&gt;sfdx&lt;/em&gt;, and you'll see &lt;em&gt;SFDX: Create Project&lt;/em&gt;. Select it. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617682659650%2FgDm1BLw9M.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617682659650%2FgDm1BLw9M.png" alt="Create Project command"&gt;&lt;/a&gt;&lt;br&gt;
In the next step, select &lt;em&gt;Standard Project template&lt;/em&gt; and hit enter.&lt;/p&gt;

&lt;p&gt;Now, give a name for your Project. I'll name it &lt;em&gt;hello world&lt;/em&gt;, but you do you.&lt;br&gt;
Select or create a folder for your project and when it's done creating, you'll see something like this as your base setup.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617649297797%2F4rrMBNT4Gq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617649297797%2F4rrMBNT4Gq.png" alt="Base setup"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Remember creating an Org at the beginning? You will have to authorize that org in order to deploy and see your changes in that org. And that is pretty simple. You will need your org's credentials to do this. (If you don't have it, you can follow &lt;a href="https://help.salesforce.com/articleView?id=sf.resetting_and_expiring_passwords.htm&amp;amp;type=5" rel="noopener noreferrer"&gt;this link&lt;/a&gt; to reset your password.)&lt;/p&gt;

&lt;p&gt;Same stuff. Open your Command Palette, type in &lt;em&gt;sfdx&lt;/em&gt; and you'll see &lt;em&gt;SFDX: Authorize an Org&lt;/em&gt;. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617682737358%2FyRYAdfv3YV.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617682737358%2FyRYAdfv3YV.png" alt="Authorize org command"&gt;&lt;/a&gt;&lt;br&gt;
Select this. Next, select the &lt;em&gt;Project Default&lt;/em&gt; URL option. In the next step, you can hit Enter to select the default alias for your org or you can actually give one. Your choice. Either way, hit Enter when you're done and it'll run the command for you.&lt;/p&gt;

&lt;p&gt;This will open the Salesforce login page and this is where you will need your org's credentials. Login and you will be prompted with a screen to allow access. Once you click Allow and go back to your VSCode, you'll see a success message like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617650147804%2FDzk2eu-an.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617650147804%2FDzk2eu-an.png" alt="Success message"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  And this is it. The next step will be creating the component.
&lt;/h4&gt;

&lt;p&gt;And to do that, yes, you guessed it right, we open our best friend Command Palette again. &lt;br&gt;
But this time, search for the command &lt;em&gt;SFDX: Create Lightning Web Component&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617683591170%2Fo7kN72E2f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617683591170%2Fo7kN72E2f.png" alt="Create lwc command"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And be careful here, don't use &lt;em&gt;SFDX: Create Lightning Component&lt;/em&gt;, this will create the Aura component instead of the Lightning web component. &lt;/p&gt;

&lt;p&gt;You will get a prompt to enter the name of the component, and you will have to enter the name in &lt;strong&gt;camelCase&lt;/strong&gt;. Since we are building a &lt;em&gt;hello world&lt;/em&gt; component, we can add &lt;strong&gt;helloWorld&lt;/strong&gt; as the name. Next, the prompt will ask you to choose the directory, you can choose the default directory. You will see something like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617678850839%2FlNal_Z2xm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617678850839%2FlNal_Z2xm.png" alt="LWC Bundle"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It will create HTML, JS and .js-meta.xml files for you. The CSS file is optional.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTML provides the structure for your component.&lt;/li&gt;
&lt;li&gt;JavaScript defines the core business logic and event handling.&lt;/li&gt;
&lt;li&gt;CSS is for styling, and this is optional.&lt;/li&gt;
&lt;li&gt;.js-meta.XML file provides metadata for Salesforce, including the design configuration for components intended for use in Lightning App Builder.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So now we know how to set up, what each file is for. Next, we can deploy our first code to our Org.&lt;/p&gt;

&lt;p&gt;Open your HTML file and you'll see a &lt;code&gt;&amp;lt;template&amp;gt;&lt;/code&gt; tag. This tag contains the HTML that defines the structure of your component.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
     &amp;lt;p&amp;gt;Hello. This is my first LWC.&amp;lt;/p&amp;gt;
&amp;lt;/template&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can don't have to modify your JS file... yet.&lt;/p&gt;

&lt;p&gt;Modify your .js-meta.xml file to this, so that you will be able to use the component in Lightning App Builder. (If you're using Webcomponents.dev, you will not see this file)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"&amp;gt;
    &amp;lt;apiVersion&amp;gt;51.0&amp;lt;/apiVersion&amp;gt;
    &amp;lt;isExposed&amp;gt;true&amp;lt;/isExposed&amp;gt;
    &amp;lt;targets&amp;gt;
        &amp;lt;target&amp;gt;lightning__AppPage&amp;lt;/target&amp;gt;
        &amp;lt;target&amp;gt;lightning__RecordPage&amp;lt;/target&amp;gt;
        &amp;lt;target&amp;gt;lightning__HomePage&amp;lt;/target&amp;gt;
        &amp;lt;target&amp;gt;lightning__Tab&amp;lt;/target&amp;gt;
    &amp;lt;/targets&amp;gt;
&amp;lt;/LightningComponentBundle&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, you're ready to deploy your first component. To do that, you can either call our best friend Command Palette or just right click on the folder and select &lt;em&gt;SFDX: Deploy Source to Org&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617684351869%2F1q7u2HHf2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617684351869%2F1q7u2HHf2.png" alt="Screenshot of deploy source to org command"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once it's been deployed, you can open the org directly using the &lt;em&gt;SFDX: Open Default Org&lt;/em&gt; command. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617684396539%2FHzsc_u-pU.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617684396539%2FHzsc_u-pU.png" alt="Screenshot of Open default org command"&gt;&lt;/a&gt;&lt;br&gt;
Once you're in the org, go to the app launcher(the square icon right below the salesforce logo), and search for &lt;strong&gt;Home&lt;/strong&gt; and open it. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617681023578%2FO64FjA0Md.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617681023578%2FO64FjA0Md.png" alt="Home page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on the setup cog(top right corner) and select &lt;strong&gt;Edit Page&lt;/strong&gt;. This will open Lightning App Builder. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617683766561%2FQfFbKirCR.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617683766561%2FQfFbKirCR.png" alt="Screenshot of edit page"&gt;&lt;/a&gt;&lt;br&gt;
You will find a list of components on the left side of the screen, scroll down to find &lt;em&gt;Custom&lt;/em&gt; and you'll see your &lt;em&gt;helloWorld&lt;/em&gt; component there, drag it and drop it on the screen.&lt;/p&gt;

&lt;p&gt;Save it and go back to the home page.&lt;/p&gt;

&lt;p&gt;And here it is, your first lwc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617681529630%2F7Uk53i74B.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1617681529630%2F7Uk53i74B.png" alt="first component"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I mean, sure, it is ugly but not bad for a first component, eh? &lt;br&gt;
Yes, go ahead. Pat yourself on the back. You deserve it.&lt;/p&gt;

&lt;p&gt;In the next part, we'll make it look a bit better, add some JavaScript too. &lt;/p&gt;

&lt;p&gt;If you liked this, keep an eye on this series. I'll be posting every day, for the next 14 days (that's the plan at least).&lt;/p&gt;

&lt;p&gt;Thanks for reading. :3&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
