Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can only load one directive at a time #517

Closed
cupojoe opened this issue Mar 19, 2015 · 3 comments
Closed

Can only load one directive at a time #517

cupojoe opened this issue Mar 19, 2015 · 3 comments
Assignees
Milestone

Comments

@cupojoe
Copy link

cupojoe commented Mar 19, 2015

Creating a second directive overwrites the first one. Even if they are in different modules. The files for the second directive don't load but they are in the angular config array.

@hannu hannu added the bug label Mar 24, 2015
@junaidrsd junaidrsd self-assigned this Mar 24, 2015
@junaidrsd
Copy link
Contributor

The problem is HERE in lib/app/js/app.js which is preventing to inject more directives. It can be fixed by replacing loadLazyModule:

       loadLazyModule: function($ocLazyLoad) {
        if (window.filesConfig && window.filesConfig.length) {
          var fileNames = [];
          angular.forEach(window.filesConfig, function(file) {
            fileNames.push(file.name);
          });
          return $ocLazyLoad.load(fileNames);
        }
      }

@junaidrsd
Copy link
Contributor

I wonder what would be the best way to write test case for this problem?

@cupojoe
Copy link
Author

cupojoe commented Mar 26, 2015

Yeah, for now I patched my local copy with a loop through all the directives and it works like charm. Something very similar to what you did but with vanilla JS instead of angular.forEach.

cyberixae added a commit that referenced this issue Mar 27, 2015
Allow loading multiple directives, fixes #517
@cyberixae cyberixae added this to the 0.3.8 milestone Mar 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants