Activity › Forums › Salesforce® Discussions › What are component Naming Rules in Salesforce Lightning?
-
What are component Naming Rules in Salesforce Lightning?
Posted by Avnish Yadav on August 23, 2018 at 10:21 AMWhat are the component Naming Rules in Salesforce Lightning?
Parul replied 7 years, 8 months ago 4 Members · 3 Replies -
3 Replies
-
Hi Avnish,
A These are Naming Rules in Salesforce Lightning
• Must begin with a letter
• Must contain only alphanumeric or underscore characters
• Must be unique in the namespace
• Can’t include whitespace
• Can’t end with an underscore
• Can’t contain two consecutive underscoresthanks
- [adinserter block='9']
-
Hi,
To add more –
I prefer using a Application name as prefix and follow the component specification .Lets say my application name is “Chat” .Then i would name my components as below
“chatcmp.cmp”
“chatcontroller.js”
“chatHelper.js”
“chatevent.evt”
“chatSVG.SVG”
Naming convention should be based on component functionality to make it easier to locate the components .
Hope this helps.
-
Hi
A component name must follow the naming rules for Lightning components.
A component name must follow these naming rules:Must begin with a letter
Must contain only alphanumeric or underscore characters
Can’t end with an underscore
Can’t contain two consecutive underscoresThanks
-
This reply was modified 7 years, 8 months ago by
Parul.
-
This reply was modified 7 years, 8 months ago by
Log In to reply.