I would like to know the best way to design an angular app regarding performance, for building an HTML template with reusable widgets like header, sidebar, footer, etc. Basically the main content is the central DIV which will have its content varying between routes, header and footer will be almost always the same, sidebar can vary in certain pages.
--- index.html
<body ng-cloak>
<div data-ng-include data-src="'partials/template/header.html'"></div>
<div data-ng-include data-src="'partials/template/sidebar.html'"></div>
<div ng-view></div>
<div data-ng-include data-src="'partials/template/footer.html'"></div>
</body>
-- header.html
<div id="header">
// ... HTML CONTENT
</div>
would it be better to have header.html in $templateCache ? Like for example:
-- header.html
<!-- CACHE FILE: header.html -->
<script type="text/ng-template" id="header.html">
<div id="header">
// ... HTML CONTENT
</div>
</scipt>
Or even should I use directives for each widget, like: <appHeader></appHeader>
... ?
Which one is better regarding performance, cohesion, reusability and scalability, in order to embed these widgets on each screen?