I creating a app in which each component have a button when click on the button the component should be rendered in the Lightning app page
but while calling the component from app i am not able to give the component name dynamically
<aura:application controller="UniversalComponentClass" extends="force:slds">
<aura:attribute name="components" type="AuraDefinitionBundle[]"/>
<aura:attribute name="componentname" type="String"/>
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<lightning:layout>
<lightning:layoutItem padding="around-small">
<div class="custom-box">
<aura:iteration items="{!v.components}" var="a">
<table class="slds-table slds-table_cell-buffer slds-table_bordered">
<td><button type="button" onclick="{!c.showCaseDeleteModal}" label="{!a.MasterLabel}">{!a.MasterLabel}</button></td>
</table>
</aura:iteration>
</div>
</lightning:layoutItem>
<lightning:layoutItem padding="around-small">
<c:{v.componentname}/>
</lightning:layoutItem>
</lightning:layout>
</aura:application>
Controller.js
({
doInit : function(component, event, helper) {
var action=component.get("c.getAllComponents");
action.setCallback(this,function(response){
var state=response.getState();
if(state=='SUCCESS')
{
component.set("v.components",response.getReturnValue());
console.log(component.get("v.components"));
}
});
$A.enqueueAction(action);
},
showCaseDeleteModal:function(component,event,helper)
{
var ss=event.target.label;
component.set("v.componentname",ss);
}
})
is there any way to pass component name dynamically to ?