How do I pass a id, change the component to a different view and load results related to that id in the init function. cmp:
<aura:iteration items="{!v.accounts}" var="account">
<a id="{!account.Id}" onclick = "{!c.getAccounts}">
{!account.Name}
</a>
<br/>
</aura:iteration>
controller:
getAccounts: function(component,event,helper){
var selectedItem = event.target.id;;
var accountEvent = $A.get("e.c:accountId");
accountEvent .setParams({ "accountId" : selectedItem });
accountEvent .fire();
}