That first (and, to the extent that the author relates the two, second) point feels pretty dubious. I imagine most adherents of the "directory by feature" camp come from the Django-like world, while "directory by type" campers have Rails-like backgrounds. I haven't found a concrete, objective reason to use one over the other. I tend to find a hybrid, "directory by feature" organization mirrored in each of the MVC rol…
Mistakes AngularJS Developers Make
21–30 of 74 posts
Re: Mistakes AngularJS Developers Make
#22That first (and, to the extent that the author relates the two, second) point feels pretty dubious. I imagine most adherents of the "directory by feature" camp come from the Django-like world, while "directory by type" campers have Rails-like backgrounds. I haven't found a concrete, objective reason to use one over the other. I tend to find a hybrid, "directory by feature" organization mirrored in each of the MVC rol…
The reason I claimed it was a mistake for angularJS devs was that angular seed and yeoman lead to doing directory by type, which I think becomes a burden as an app scales.
Re: Mistakes AngularJS Developers Make
#23Re: Mistakes AngularJS Developers Make
#24Hey - #8 regarding "consulting the prototype chain if the value is an object" is something of an oversimplification, and slightly incorrect. The prototype chain is more or less always consulted because that is the only way to evaluate the property on a child scope. What is happening in the first example is that the ng-bind directive is creating a new entry on the child scope, called "user", which overwrites the refer…
Thanks for the example!
Re: Mistakes AngularJS Developers Make
#25Not mentioned: Coding things so that your site content is invisible to the Google search engine. Which is ironic considering Google's support of Angular
Re: Mistakes AngularJS Developers Make
#26There might be a lot of reasons to use dir-by-feature or dir-by-function but if the above is a problem you should probably get a better editor.
EDIT: or use yours better.
Re: Mistakes AngularJS Developers Make
#27> Whether using Sublime, Visual Studio, or Vim with Nerd Tree, a lot of time is spent scrolling through the directory tree. There might be a lot of reasons to use dir-by-feature or dir-by-function but if the above is a problem you should probably get a better editor. EDIT: or use yours better.
Re: Mistakes AngularJS Developers Make
#28Grouping files by feature has made navigating and reasoning about a codebase so much easier. I've even found myself grouping stylesheets & test files alongside templates and app code, it really helps enforce the idea of composing smaller apps together. Google has released a recommended app structure similar to this as well [0], though I haven't actually seen it being used too often in the projects I've come across. […
Furthermore most likely you will be sharing many partial templates or widgets between different views and sections in your app. So those have to go in some sort of common views folder, losing much of your grouping.
I wouldn't say either way is right or wrong, it just depends on your workflow, size of the app and size of the team working on it.
Re: Mistakes AngularJS Developers Make
#29Re: Mistakes AngularJS Developers Make
#30Point 3 about "Dependency injection" is often not needed. Just use ng-annotate before minify/uglify, and it will convert the code to the array syntax for you. It handles most of the cases, leaving your code without the ugly array stuff. It doesn't work for everything, though, so suddenly it blows up. So if you want to be 100% sure your code works as intended do it manually.
[0]: https://github.com/olov/ng-annotate#explicit-annotations