angularjs - Proper angular file structure -


what best angular file structure me? project going spa video feed on main page, , pages view specific posts. want users able login, vote on content , admin section add content.

you can see file structure here - https://github.com/bliitzkrieg/trailerfeed or below

/app    /assets       /css           main.css           main.min.css       /sass           main.scss           _variables.scss           /components                _header.scss    /components        /dashboard        /feed            _feed.html            feed.js            feedcontroller.js        /header             _header.html            header.js            headercontroller.js            headerdirective.js    /spec        app.spec.js    app.js    index.html    routes.js 

your file structure looks fine. have files organized component rather type. suggest removing underscore prefix templates redundant. every template in angular partial don't need indicated such.

you may want keep unit tests in components directory well. headerdirective.spec.js can live in header component folder.

controllers classes , instantiated individual instances (as apposed services classes injected singleton). controllers should named in pascalcase rather camelcase.

it seem component scss should live rest of component files well. there valid reasons not this.


Comments