How to reference a component in the Lightning namespace?

How to reference a component in the Lightning namespace?

Within an HTML template, to reference a component in the lightning namespace, use < lightning -component>. The hyphen character ( -) separates the namespace from the component name. This component references lightning-card, which is a base Lightning component in the lightning namespace.

What does hyphen mean in Lightning Component Library?

The hyphen character ( -) separates the namespace from the component name. This component references lightning-card, which is a base Lightning component in the lightning namespace. It also references c-contact-tile, which is a custom component in the same project.

Can a custom lightning component access a custom aura component?

A custom Lightning web component can’t access a Lightning web component or module in a custom namespace. It can access Lightning web components and modules only in the c and lightning namespaces. A custom Lightning web component and a custom Aura component in the same namespace can’t have the same name.

When to use C as the default namespace?

The following illustrates references to elements in your organization when your organization doesn’t have a namespace prefix set. References use the default namespace, c, where necessary. … … … The following illustrates references to elements in your organization when your organization has set a namespace prefix.

Which is an example of a namespace prefix?

Organizations with a Namespace Prefix Referenced Item Example Component used in markup Component used in a system attribute

How to show error messages in Lightning aura component?

We have used ui:message tag to display error messages in lightning component. Lightning Ui namespace is deprecating soon hence we are migrating Ui namespace tags to the lightning namespace.

When to use the default namespace in Salesforce?

Every component is part of a namespace, which is used to group related components together. If your organization has a namespace prefix set, use that namespace to access your components. Otherwise, use the default namespace to access your components.

What should the class name be in lightning.js?

The convention is for the class name to be Pascal Case, where the first letter of each word is capitalized. For myComponent.js, the class name is MyComponent. Extend LightningElement to create a JavaScript class for a Lightning web component.