Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to load a different layout in angularjs

I have 2 layout files. Layout-1 Layout-2

The route /one is the starting point which loads the Layout-1, but now if I click on a link /two it gets me the file, but with Layout-1, instead i want, if i hit /two, Layout-2 should be loaded.

If i refresh the page, i get the correct thing coz that time i hit the server directly. So is there any way from angular to specify which layout file to load from Server.

Thanks.

like image 806
Aamir Shah Avatar asked Jun 24 '13 10:06

Aamir Shah


1 Answers

Loading new layout template means loading new html embedded with new javascript and css files. This is equal to redirecting page to new location. You can use $window.location.href="new/layout/template". Read angularjs developer guide for more info.

like image 111
McLosys Creative Avatar answered Oct 13 '22 12:10

McLosys Creative