calling a lightning component from another component on a button click code example
Example: calling lightning component from another lightning component
var evt = $A.get("e.force:navigateToComponent");
console.log('Event '+evt);
var accountFromId = component.get("v.recordId");
evt.setParams({
componentDef : "c:AffiliateSaveForm" ,
componentAttribute : {
accId : accountFromId
}
});
evt.fire();