I am writting an app from scratch in Angular with node.js and I was wondering if I am doing things correctly.
I want to split the content of my index into smaller html modules with their respective controllers, this way, everything will look more structured and easy to find when the project gets bigger.
For example :
- index.html <--- main file
- /views/menu.html <--- menu module
- /views/content.html
- /js/menu.js <---controller for the html module
- /js/content.js ...
I can manage those files by just adding ng-include :
e.g
< ng-include src=" 'views/menu.html' ">
My concern is that this is like a GET request per file and I was wondering if this would affect the load speed of my application. Because I am working in local, this loads in 2ms which is very quick but I was wondering how this would behave online.
My questions are :
- Is this the best way to create a modular app with different html files and js controllers ?
- Is there a better way to achieve what I want to do ?
I am still learning Angular, sorry if this is too basic.
Thanks