Skip to content

Instantly share code, notes, and snippets.

View ketan-benegal's full-sized avatar

ketan-benegal

  • CloudFountain Inc.
View GitHub Profile
<img class="wp-image-2079" src="https://www.thecloudfountain.com/wp-content/uploads/2019/03/word-image-4.png" />
<h3><a id="post-2074-_lioho6iizjtj"></a>3. Create a Lightning web component</h3>
<ol>
<li>In Visual Studio code, press Command + Shift + P on a Mac or Ctrl + Shift + P on Windows.</li>
<li>Type <em>SFDX</em>.</li>
<li>Select <em>SFDX: Create Lightning Web Component.</em></li>
<li>Press <em>Enter</em> to accept the default <em>force-app/main/default/lwc.</em></li>
</ol>
import { LightningElement, track } from 'lwc';
export default class CloudFountain extends LightningElement {
@track greeting = 'Cloud Fountain';
}
}
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="helloWorld">
<apiVersion>45.0</apiVersion>
<isExposed>true</isExposed>
<targets>
@ketan-benegal
ketan-benegal / ToastComponent.cmp.xml
Last active March 12, 2018 03:34
Lightning Toast
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,flexipage:availableForAllPageTypes" access="global" >
<div>
<lightning:button label="Information" variant="brand" onclick="{!c.showInfoToast}" />
<lightning:button label="Error" variant="destructive" onclick="{!c.showErrorToast}" />
<lightning:button label="Warning" variant="inverse" onclick="{!c.showWarningToast}" class = "warning_cls" />
<lightning:button label="Success" variant="inverse" onclick="{!c.showSuccessToast}" class = "success_cls" />
</div>
</aura:component>