createComponents()
Create an array of components from a list of types and attributes. This method accepts a list of component names and attribute maps, and a callback to notify the caller.
createComponents(Array components, function callback)
components: Type: Array. The list of components to create. For example, ["lightning:button", {"onclick":component.getReference("c.handlePress")}]
callback(components, status, errorMessage): Type: function. The callback to invoke after the components are created. The callback has three parameters.
components—The components that were created. This parameter enables you to do something with the new components, such as add them to the body of the component that created them. If there’s an error,componentsisnull.status—The status of the call. The possible values areSUCCESS,INCOMPLETE, orERROR. Always check that the status isSUCCESSbefore you try to use the components.errorMessage—The error message if the status isERROR.
See Also