I know the question that was asked before:
Change templateUrl directives based on AngularJS screen resolution
This was first asked over a year ago, and since then AngularJS has changed a bit. I am curious to find out if there are other ways to achieve something similar, since I did not find much information about the exchange of templates, so maybe I am barking the wrong tree here.
I have a single page application without any routes.
HTML:
<body ng-app="App">
// lots of html same for both desktop/mobile
<my-dir></my-dir>
// even more here
</body>
pattern 1:
<p>Mobile</p>
pattern 2:
<p>Desktop</p>
I would like to make pattern 1 when the screen is below 700px and pattern 2 . Templates change what is inside the my-dir directive . For example, template 1 displays a list and template 2 displays a table.
, ( )
, ?