Well, I'm not sure what you are looking for, but if you want to call Cmp2 from Cmp1 you can pass the href as a string attribute. You then say one link to record... which record are you talking about? Your post is not clear.
hy Martha thanks done with it ,below code sort it out
<a href="javascript:void(0)" onclick="{!c.doSomething}"> Click me to do Something </a> Controller of this component Cmp1 doSomething : function(component,event, helper) { console.log('Hey There .. the anchor was clicked'); console.log(event); var href = event.srcElement.href; console.log(href);
<a href="javascript:void(0)" onclick="{!c.doSomething}">
Click me to do Something
</a>
Controller of this component Cmp1
doSomething : function(component,event, helper) {
console.log('Hey There .. the anchor was clicked');
console.log(event);
var href = event.srcElement.href;
console.log(href);
}
https://developer.salesforce.com/docs/component-library/bundle/lightning:navigation/documentation