Continuing with the previous example of organizing code, we can continue and create as many templates as necessary for the dynamic directives.
We will see in this example the use of
ng-include, a built-in AngularJS directive using external templates, created in specific files, thus facilitating easy maintenance and scalability.
Also, we will see a different way to load the content using the
$resource service in our controller function.
The baseline code for this recipe is the same as in the previous chapter. We just need to create additional files.
For the purpose of this book, we will place the new directive in the same file as the previous one. In a real application, we strongly recommend the use ...