On a large AngularJS application having all my controllers in a single "controllers.js" file seems a little un-maintainable to me. Is there a better way to do this such as:
\js\controllers\myController.js \js\controllers\yourController.js \js\controllers\ourController.js
and that also applies for filters, services, directives etc...
The main building blocks of Angular are modules, components, metadata, templates, data binding, services, directives, and dependency injection.
js file. Now you need to download a copy of angular. js file to your computer and replaces the CDN link in the head with the link to the file you downloaded.
top-level “app” folder : all angular files should be placed within a folder that could be named as “app”. “app” is the top-level folder. app/components folder: one or more components can be placed within “app/components” folder.
It is a software design pattern for developing web applications. It is very popular because it isolates the application logic from the user interface layer and supports separation of concerns.
There are lot's of ways to organize your code. You can look in the following links
You can follow their standard or you can make your own.
Try to follow the following guidelines:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With