Skip to main content
1 of 2
glls
  • 20.3k
  • 19
  • 49
  • 83

The redirection should be managed in your client side controller using a lightning navigation event.

Anchor Tag:

component.cmp

<aura:component>
    <aura:attribute name="recordId" type="String" />
    
    <p><a onclick="{!c.handleClick}">link to record</a></p>
</aura:component>

controller.js

/* navToRecordController.js */
({
    handleClick: function (component, event, helper) {
        var navEvt = $A.get("e.force:navigateToSObject");
        navEvt.setParams({
            "recordId": component.get("v.recordId")
        });
        navEvt.fire();
    }
})
glls
  • 20.3k
  • 19
  • 49
  • 83