ads

Tuesday 28 November 2017

General Coding Questions


Q: Where can a component be displayed?
A: After you create a component, you will want to display it somewhere. There are a number of possibilities.
  • Lightning Experience: Display your component in the Lightning Experience using the App Builder. You can edit the home page, edit a record detail page or create/edit a new app page to include it. Alternatively, you can create a custom Lightning tab that references your component and add that tab to your Lightning navigation.
  • Salesforce1 Mobile app: Display your component in the Salesforce1 Mobile app by creating a custom Lightning tab that references it and adding that tab in your mobile navigation.
  • Template-based community: Display your component in your template-based (e.g. Napili) community using the Community Builder.
  • Standalone Lightning app: Create a standalone Lightning app (e.g. myapp.app) and include your component in this app. Access your Lightning app by URL.

Q: Do I always create an app bundle first?
A: Not necessarily, you can start with a Component bundle.

Q: How much Javascript do I need to know to develop Lightning Components?
A: You need at least intermediate-level JavaScript knowledge.

Q: Are Lightning Components intended only for mobile apps?
A: Components have been built to be mobile first, but with responsive design in mind. With Lightning you can build responsive apps fast for desktop, mobile and tablets.

Q: How do I deploy components to my production org?
A: You can develop Lightning Components in a sandbox or Developer Edition org and then deploy them to any organization that supports Apex using managed packages, Force.com IDE, Force.com Migration Tool or Change Sets. NOTE: We don’t recommend changing your development process to use namespaces and managed packages if you aren’t already using them.

Q: How do I include external JavaScript libraries in my components?
A: You can use a RequireJS component or Loader component (https://github.com/rajaraodv/loadcomponent) to load external JS or CSS files.

Q: Can I integrate Lightning components with another framework, such as Angular?
A: Yes. You can include the working 3rd party code inside a Visualforce Page, embed the Visualforce Page inside a Lightning Component. This Lightning Component can be used as any other Lightning Component in various environments.
The use of 3rd party frameworks directly inside Lightning Components is not supported. Packages with components that directly include 3rd party frameworks submitted to the AppExchange security review will automatically fail. We strongly suggest that your review our security review requirements for components before submitting.

Q: How is Lightning aware of what record you are on if you embed it in Salesforce1? (i.e. how do you get the ID of the record you are on like in a standard controller)?
A: Your component just needs to implement the force:recordTab interface and the record and recordId will be automatically injected when your component is wired into record home.

Q: Are there any CSS (styles) provided by salesforce.com as part of the supported Lightning Components?

No comments:

Post a Comment