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
Heather DykstraHeather Dykstra 

Lightning Component Switching?

Is it possible to switch between different components in a ligttning application?  Not necessarily dynamically creating a nested component, but navigating to a component that already exists.  NavigateToComponent has no documentation and no longer works in the Spring '15 version.  

Also is it possible to switch between different lightning apps with navigatetoURL?
Best Answer chosen by Heather Dykstra
NagaNaga (Salesforce Developers) 
Hi Heather,

$A.get("e.force:navigateBack").fire();
just console.log($A); and the available functions can be seen

But i dont think its recommended

https://developer.salesforce.com/forums/?id=906F0000000BK9dIAG

Best Regards
Naga Kiran
 

All Answers

NagaNaga (Salesforce Developers) 
Hi Heather,

$A.get("e.force:navigateBack").fire();
just console.log($A); and the available functions can be seen

But i dont think its recommended

https://developer.salesforce.com/forums/?id=906F0000000BK9dIAG

Best Regards
Naga Kiran
 
This was selected as the best answer
Mohith Kumar ShrivastavaMohith Kumar Shrivastava
You can hide or show elements using Toggle Add and remove classes .
 
hidenewBtn:function(component,event) {
		var toggleBtn= component.find("Newbtn");
		$A.util.removeClass(toggleBtn,'btn btn-primary btn-lg btn-block');
		$A.util.addClass(toggleBtn,'toggle');
	}
	
	//CSS file
	
/*toggleCss.css*/
.THIS .toggle {
   display: none;
}

I wrap the content inside div and handle using CSS display none property.