2

I have a module qApp

angular
  .module('qApp', [
    'ngCookies',
    'ngRoute'
  ])

Later while program is running I dynamically load js scripts that contain other modules (lets call them plugin-modules).

Example:

angular
  .module('q-plugin-email', [])
  .constant('name', 'q-plugin-email')
  .factory('factory', [
    function() {
      return {/*...*/}
    }
  ])
  .directive('ui', [
    function() {
      return {/*...*/}
    }
  ]);
  1. How do I actually add plugins to qApp dependency list after the app module was created?

  2. Will it be possible to name factory and directive with the same name in every dependant plugin (so it was possible to follow the unique pattern creating plugins)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.