Switch templates depending on screen orientation

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.

Check out post.

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

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