npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

angular-modular-app-manager

v0.9.1

Published

This module allows AngularJS applications to be created and loaded in a modular fashion, eliminating the risk of loading scripts relevant to the application in the incorrect order, while also promoting best practices for using the JavaScript Module Patter

Downloads

10

Readme

angular-modular-app-manager

This JavaScript module allows AngularJS applications to be created and loaded in a modular fashion, eliminating the risk of loading scripts relevant to the application in the incorrect order, while also promoting best practices for using the JavaScript Module Pattern.

Usage

  1. Install via Bower:
bower install angular-modular-app-manager --production
# or
npm install angular-modular-app-manager --production

or manually download.

  1. Include the angular-modular-app-manager source file after AngularJS but before your own source files:
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.9/angular.min.js"></script>
<script src="bower_components/angular-modular-app-manager/dist/angularModularAppManager.min.js"></script>
<script src="js/myAngularApp.js"></script>
<script src="js/auth/auth.service.js"></script>
<script src="js/auth/auth.controller.js"></script>
...

This order will ensure all dependencies are resolved correctly.

  1. When writting your AngularJS application, use the global angularModularAppManager object to bootstrap your application and add all of the modules (directives, services and controllers):
function bootstrapMyAngularApp() {
  return angular.module('myApp', []);
}

function createMyAppAuthController(angularModule) {
  angularModule.controller('AuthController', ['$scope', 'AuthService', function ($scope, AuthService) {
    // My controller code here.
  }]);
}

function createMyAppAuthService(angularModule) {
  angularModule.service('AuthService', ['$q', '$http', function ($q, $http) {
    // My service code here.
  }]);
}

angularModularAppManager.createAngularModule(createMyAngularApp);
angularModularAppManager.addNewModule(createMyAppAuthController);
angularModularAppManager.addNewModule(createMyAppAuthService);

As in the example above, when bootstrapping your AngularJS application with angular.module, you should wrap the call in a function that returns the angular module then pass that function (createMyAngularApp in the example) as the argument of the createAngularModule function.

When creating the other parts of your application such as services, directives or controllers, where you would normally write something like angular.module('myApp').controller(...) you should wrap the call in a function that has the angular module as a parameter and pass that function as the argument of the addNewModule function, such as the createMyAppAuthController and createMyAppAuthService functions in the example above.

Regarless of the order the modules are added, the angular modular app manager will ensure that your application is first bootstrapped then each module is initialised.

Sample

In the repository and with the bower package you will see a simple sample project that fully demonstrates how to use this module. The sample application scripts also demonstrate how to check for dependencies and initialise the application if this module is not present as a fallback. It is worth checking them out.

Development

  • Clone the repository or download it
  • Install dependencies: npm install
  • Run gulp

Pull requests are welcome!

License

MIT http://ceottaki.mit-license.org/

Thanks

Thanks to Ben Cherry for a great explanation on the JavaScript module pattern.

TODO

Currently you can only load one angular application with this module, so next up will be to enable it to handle more than one angular application.