You need to sign in to do that
Don't have an account?
Chintha santosh
lightning:navigation
Navigating component from another component..
On clicking the button i didn't get the target component..
component:
<aura:component implements="lightning:isUrlAddressable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome" access="global">
<aura:attribute name="pageReference" type="Object"/>
<lightning:navigation aura:id="navService"/>
<lightning:button name="test" label="Navigate to Account list view" onclick="{!c.navigate}" />
</aura:component>
JS Controller:
({
Navigate: function(component, event, helper) {
var pageReference = component.find("navService");
var pageReferenceNav = {
"type" : "standard__component",
"attributes" : {
"componentName" : "c__LC_BookMyHome_3008"
},
"state" :{
"myAttr" : "atrvalue"
}
};
pageReference.navigate(pageReferenceNav);
},
})
On clicking the button i didn't get the target component..
component:
<aura:component implements="lightning:isUrlAddressable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome" access="global">
<aura:attribute name="pageReference" type="Object"/>
<lightning:navigation aura:id="navService"/>
<lightning:button name="test" label="Navigate to Account list view" onclick="{!c.navigate}" />
</aura:component>
JS Controller:
({
Navigate: function(component, event, helper) {
var pageReference = component.find("navService");
var pageReferenceNav = {
"type" : "standard__component",
"attributes" : {
"componentName" : "c__LC_BookMyHome_3008"
},
"state" :{
"myAttr" : "atrvalue"
}
};
pageReference.navigate(pageReferenceNav);
},
})
If it helps, Please mark this answer as Best. Thank You!