Search code examples
angularjsngboilerplate

Where should I place application specific directives with ngBoilerplate?


With ngBoilerplate, where should I place and how should I structure my application wide filters, services and directives?

src/app

The app directory seems to be arranged around routing.

Apart from app.js and its accompanying tests (discussed below), this directory is filled with subdirectories corresponding to high-level sections of the application, often corresponding to top-level routes.

This is not the case, these do not correspond to a high-level section of the application, let alone to routes.


src/common

There is also a common directory however. The README.md states:

The src/common/ directory houses internal and third-party re-usable components. Essentially, this folder is for everything that isn't completely specific to this application.

Every component contained here should be drag-and-drop reusable in any other project; they should depend on no other components that aren't similarly drag-and-drop reusable.

Which doesn't seem to apply in my case, as these items are specific to this application and wouldn't work in other apps.

(Edited to address the src/common folder)


Solution

  • If its application wide, you would put filters, services, and directives in the common folder.