Reputation: 855
Does anyone knows how to load angularjs views on page load? This will improve speed and minimize network traffic. For example this:
<div ng-switch-when="home">
<div ng-include="'views/home.html'"></div>
</div>
"home.html" to be included from cache and without request to server every time the view is changed. Thanks.
Upvotes: 0
Views: 84
Reputation: 4167
You can include templates on a page with
<script type="text/ng-template" id="views/home.html">
<yourtemplatehere/>
</scipt>
http://docs.angularjs.org/api/ng.directive:script
Upvotes: 2