July 2018
Beginner to intermediate
458 pages
9h 58m
English
If you have too many aura:if statements inside aura:iteration, you can transfer some logic to the controller to create markups conditionally using the $A.createComponents() API. The code snippet for this technique is shown, and, depending on the conditions, you can build the final component markup. Let's take a look at the code:
$A.createComponent(componentName, options, function(comp) { var body = component.get("v.body"); body.push(comp); component.set("v.body",cmp);});
This method reduces the number of components and improves performance. However, you are still using the framework, and there is some rendering cost consumed from the framework.
Read now
Unlock full access