function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
factory factoryfactory factory 

Lightning components switching between components

Hi guys,

I'm playing with lightning components and I'm having a problem with switching between components.
I was able to accomplish the switch from component A to B by using $A.get("e.force:navigateToComponent") which worked like a charm. But I cannot find another way except window.history.back() to get back from B to A. This kind of works but shows some strange behaviour with the back button in SF1 and if I go back from A to B again I have to press the back button two times to get back from B to A again ... so kind of strange :)

Does anyone know how to do this the right way?
Thank you!
factory factoryfactory factory
Got it !
$A.get("e.force:navigateBack").fire();
just console.log($A); and the available functions can be seen
SkipSaulsSkipSauls
Please note that neither or these are supported events. Consult the docs for officially supported components, events, etc. Use of random functions, events, and the like that you discover via JavaScript is discouraged, and is not supported by SFDC.

Thanks,

Skip
Heather DykstraHeather Dykstra
Is there a way to do this that IS supported by SFDC? This would make lightning much more useful to my org.

Thank you!