lefos987 / generator-ghurt

MIT License
23 stars 1 forks source link

angular style guide and best practices #2

Closed wallies closed 10 years ago

wallies commented 10 years ago

im wondering whether we should adhere to these for the client side of things http://blog.angularjs.org/2014/02/an-angularjs-style-guide-and-best.html?m=1 https://docs.google.com/document/d/1XXMvReO8-Awi1EZXAXS4PzDzdNvV6pGcuaF4Q9821Es/pub

This would change where our unit tests go and also how we name certain types of files.

lefos987 commented 10 years ago

We apply a lot of how the app should be structured, which is really good. I think we need to discuss if we actually move the tests in the same directory as the src code. Probably we should since it will allow us to logically group together all the files of a component and ideally move it from project to project very easily. Regarding styles and css I am not sure if it is actually the best idea. A lot of components might share styles so creating a 1-1 relationship between a css file and a module might result in repeated styling. On the other hand I love the idea of keeping everything that is required by a component in one unit. @maxwellito what do you think?

wallies commented 10 years ago

i like keeping styles and css as they are, much easier to share common styles and cuts down on duplicating which i think could happen if we went modular for css. I personally think we should move tests into the same folder as that makes logical sense to me. Did you also see the recommendations of naming files @lefos987?

maxwellito commented 10 years ago

Having the script and the test at the same place is not a bad idea. Because we always work with both when we code. I'm just a bit disappointed about the _test.js, I find .spec.js cleaner. I also don't want to put all the scripts in the app folder, let's keep our solution. About the scripts, we need to split them to make a file for each type : directory, controller.. It's easier to do with a generator, I'm just scared it will make the repo messier.