Im making an 'interactive menu' that moves along with user clicks. Im wondering if there is a way to include html templates in ng-switch, since all the logic is different in each 'switch' - it will result in huge html files.
<div class="content" ng-switch on="selection">
<div ng-switch-when="1" >
<h1>1</h1>
</div>
<div ng-switch-when="2">
<h1>2</h1>
</div>
</div>
You should be able to do it with
ng-include
directive :Use
ngInclude
:Note: Dont forget to use single quotes wrapped inside the double quotes if you are hard-coding the path.