Live data from Hacker News

Code Organization in Large AngularJS and JavaScript Applications

cliffmeyers.com

1–10 of 24 posts

Re: Code Organization in Large AngularJS and JavaScript Applications

#4
post #2

Body text is really light making it hard to read, at least on my eyes. The content seems interesting though.

Thanks for the feedback. I made the text darker.

If you're in the mood for constructive feedback, there's something that makes that page difficult to read. It could just be font rendering at that tiny size, it could be the contrast with the line spacing given the text size. Either way, taking the font-size up to 15px makes it readable, for me.

Re: Code Organization in Large AngularJS and JavaScript Applications

#5
post #2

Body text is really light making it hard to read, at least on my eyes. The content seems interesting though.

Thanks for the feedback. I made the text darker.

It's also a good idea to use font-size:100% let the browser/user decide what font size to use , yours is a bit small. It should not break your layout. nice article.

Re: Code Organization in Large AngularJS and JavaScript Applications

#6
This has always been a pet peeve of mine with projects like rails. Usually when I work on a piece of the system I'll be working on a single component, be it user, product, report or whatever. That means I will either have a bunch of different directory trees open in my IDE (Which can be bigger than a screen for large projects), or I will be using some quick-open tool (Which still is great when you know what you want, but less so when you just want to get a quick overview of a component).

God forbid I try to edit multiple components at a time, and forget browsing my repo on github. Organization like this would make life so much easier in so many ways.

Re: Code Organization in Large AngularJS and JavaScript Applications

#7
I was surprised at Angular-seed's directory structure. It is fine for toy apps, but that isn't what it is really being billed as.

I'm building a django/angular app. Each django app gets its own angular module, and each angular module roughly shares the seed structure, but may be broken into more files (much like the second example in TFA). So my whole structure looks something like:

  django-project/
    app1/
      views.py
      static/
        coffeescript/
          app1.coffee #defines the module
          app1/
            directives.coffee
            controllers/
              foobaz_controller.coffee
        ...
The only thing I'm not keen on is the duplication of "app1" in the directory structure. It is done to prevent conflicts when static files are collected, but is redundant during development.

Thinking through this, I might be able to build a static files finder that looks for an angular directory in the django app and puts it in the right place. I'll have to think about that, since there are a lot of moving pieces with pipeline, et al, involved in the chain.

Re: Code Organization in Large AngularJS and JavaScript Applications

#8
I'm not sure I agree with the idea of adding utility methods to the $rootScope to avoid wiring in dependencies repeatedly. I would probably go with defining a utility class and indeed injecting it into every controller that needs it. I like the idea of having my utility methods clearly defined in one place. Any opinions here on the pros/cons?

Re: Code Organization in Large AngularJS and JavaScript Applications

#9
post #2

Body text is really light making it hard to read, at least on my eyes. The content seems interesting though.

Thanks for the feedback. I made the text darker.

Thanks, I'll look at adjusting the base font size as well. I agree it's a tad small.
Post reply on HN