I was wondering about the best way to structure an angular.js application. I believe that all directives download their respective templates via an ajax request. Therefore, is it better to enclose each distinct section of an SPA in a directive as an individual unit with its own template html and controller:
<html>
<head>
</head>
<body>
<section>
<directive1></directive1>
</section>
<section>
<directive2></directive2>
</section>
<section>
<directive3></directive3>
</section>
</body>
</html>
Or is it better to reserve directives for DOM manipulation and embed all controllers inside the main html page:
<html>
<head>
</head>
<body ng-app="myapp">
<section ng-controller="controller1">
...
</section>
<section ng-controller="controller2">
...
</section>
<section ng-controller="controller3">
...
</section>
</body>
</html>
I was wondering what the advantages and disadvantages of each approach are, in terms of performance, best practices etc. Thanks in advance.