Also, keeping dynamic templates in JS files is not a very flexible way to structure and maintain the application.
This recipe is connected directly to what comes next, since we use the structure as an example to show the flexibility that can be achieved by prioritizing performance and easy maintenance.
As we have mentioned in previous chapters, an easy way to group files in an application is to keep them united by features. Thus, nothing could be easier than keeping all files related to a directive in the same place.
But what do you do when you need to use the same file or template, since we are talking about dynamic templates?
A simple and efficient way to do this is to use the directive of...