Newer Version Available
Using a Third-Party Framework
Only single-page applications work in lightning:container. Your application should have a launch page, which is specified with the src attribute. By convention, the launch page is index.html. The following example shows a simple Lightning component that references myApp, an app uploaded as a static resource, with a launch page of index.html.
The contents of the static resource are up to you. It should include the JavaScript that makes up your app, any associated assets, and a launch page.
As in other Lightning components, you can specify custom attributes. This example references the same static resource, myApp, and has three attributes, messageToSend, messageReceived, and error. Because this component includes implements="flexipage:availableForAllPageTypes", it can be used in the Lightning App Builder and added to Lightning pages.
The component includes a lightning:input element, allowing users to enter a value for messageToSend. When a user hits Send, the component calls the controller method sendMessage. This component also provides methods for handling messages and errors.
There’s a lot going on in this Lightning component, but don’t worry. We’ll break it down and explain how to implement message and error handling as we go in Sending Messages to and from the App and Handling Errors in Your Container.