Giter Site home page Giter Site logo

Comments (1)

aaronallport avatar aaronallport commented on July 2, 2024

George,

Thanks for getting in touch. I'll try to address each of your points separately:

I noticed that every Angular component seems to be its own module. For instance, when creating a controller, the angular module is "myApp.controllers.MyController". Is there a reason that?

Personal preference. I prefer to keep everything separate to de-couple as much as possible.

When generating a new Angular entity, it gets automatically inserted into app.js in a way that it gets loaded in the app initialization. Is there a reason for not lazy loading every component?

This depends on your individual needs. Yeoman generators are purposefully opinionated, and this one is of the option of bundling up application JS, minifying etc using the RequireJS optimiser. Lazy loading each component means lots of HTTP requests, and bundling removes the need to more HTTP requests. Again, this depends on individual needs.

In terms of performance, does requirejs brings a great improvement to angular?

I'd point you to my previous answer for this one too.

I've read several articles out there showing how to lazy load controllers and others saying NOT to use requirejs as the AMD framework for Angular. I guess you might have a strong opinion about it. Do you mind shedding some light about it?

Again, it depends on your needs and personal preferences. RequireJS allows you to specify dependencies outside of your angular code such as jQuery, so it can be good for explicitly stating dependencies to ensure that they are available when angular needs them. Thats my personal opinion, but I was using RequireJS before AngularJS came along, and to me it made sense to keep using it, combining the best of both worlds (in my case).

Thanks for taking an interest in my work, and I'm always happy to accept suggestions, or better yet, pull requests!

Cheers,

Aaron

from generator-angular-require.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.