Switch templates depending on screen orientation


#1

i think the title say all what i’m trying to do, i have two templates , and i was wondering , how to switch from template1 to template2 depending on the user screen orientation :
if( landscape ) use template1
if( portrait ) use template2

or maybe if this isn’t available for landscape and portrait mode i can use screen density and resolution to switch template.


#2

Check out post.


#3

thanks that’s what i was looking for, i was going to do something similar for the templateUrl on my state but i’m stuck on the part of detecting the current orientation of the device, how to handle the event of current orientation and where is the current orientation variable stored ? i get undefined on $rootScope.orientation


#4

What did you implement finally? I’m looking for same