Code Monkey home page Code Monkey logo

Comments (6)

ealtenho avatar ealtenho commented on May 6, 2024

@caguillen214 is looking into this as it is somewhat close to his logic for checking for different directives.

from angular-hint.

caguillen214 avatar caguillen214 commented on May 6, 2024

So after doing a little investigation, I figured out that the way to get the directives loaded/created isn't as similar to how we can get the modules loaded/created as we first imagined.

I came up with the approach below, which is significantly simpler than what has to be used in the directives. Essentially by checking the dependencies of all modules created, we know which modules are eventually going to be loaded. Keeping track of the modules created and the ones to be loaded, allows us to then compare the two sets and find out which modules were created but _not_ loaded

angular.module = function() {
  var module = llLib.originalAngularModule.apply(this,arguments);
  if(module.requires.length) { // if the module has dependencies
    llLib.storeDependencies(module); //store those dependencies as modules that will be loaded
  }
  llLib.createdModules[module.name] = module; //store the module as one that has been created
  return module;
};

However, this approach is limited in the sense that the only modules that it knows are going to be loaded are ones declared as dependencies for other modules. If there is in fact a way to load in a module aside from doing it as dependency in another module, this approach will not work for those cases. Thoughts? Are there other ways to load modules besides as dependencies, @btford?

from angular-hint.

caguillen214 avatar caguillen214 commented on May 6, 2024

This is being addressed temporarily at: https://github.com/caguillen214/loading-loader

It's in a good place to be transferred over to angular-hint. Can we make a repo and come up with a name for this one? @btford

from angular-hint.

btford avatar btford commented on May 6, 2024

Mostly just not sure what to call this :/

from angular-hint.

btford avatar btford commented on May 6, 2024

Added: https://github.com/angular/angular-hint-modules

from angular-hint.

caguillen214 avatar caguillen214 commented on May 6, 2024

This is closed. It will be tracked further in the repo mentioned above.

from angular-hint.

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.