Component1
<aura:component implements="force:appHostable">
<aura:attribute name="accountid" type="String" />
<ui:inputNumber aura:id="test1" label="Name" />
<ui:button label="Navigate" press="{!c.Naviagte}" />
</aura:component>
({
Add: function(component, event, helper) {
var get_name = component.find("testt1").get("v.value");
var evt = $A.get("e.force:navigateToComponent");
evt.setParams({
componentDef: "c:Component2",
componentAttributes: {
accountid: get_name
}
});
evt.fire();
}
})
Component2
<aura:component implements="force:appHostable">
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
Hello
</aura:component>
Controller
doInit: function(component, event, helper) {
var ResultValue = event.getParam("accountid");
// it navigate fine but i am not able to get pass attribute value here
}
e.force:navigateToComponent
is an undocument event which is not officially supported by Salesforce.Use$A.createComponent
to create components as given in the above link's answer