Skip to content

Instantly share code, notes, and snippets.

@mikemclin
Created September 4, 2014 14:09
Show Gist options
  • Save mikemclin/566be14dc2feba445258 to your computer and use it in GitHub Desktop.
Save mikemclin/566be14dc2feba445258 to your computer and use it in GitHub Desktop.
Add late dependency to Angular module that has already been created
// Module `myApp` is already created. We were unaware that we needed
// the `anotherModuleDependency` module when we created `myApp`. The
// below code allows us to add `anotherModuleDependency` to the
// `myApp` dependency list.
angular.module('myApp').requires.push.apply(
angular.module('myApp').requires, ['anotherModuleDependency']
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment