Skip to content

prevent elements are bootstrapped more than once #2

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

revington
Copy link

An element like

<div ng-module="Products" ng-controller="ProductsCtrl" class="container-fluid">

will generate an error like Uncaught Error: [ng:btstrpd] App Already Bootstrapped with this Element '<div ng-module="UserNotfications" ng-controller="UserNotificationsCtrl" class="ng-scope">

Also:

  1. Can you explain your code convention? I tried to format the code in the same way you do, but it is not clear to me what convention you use.
  2. I do not understand this part

   className = ' ' + element.className + ' ';              
   match = NG_MODULE_CLASS_REGEXP.exec(className);         
  if (match) {                                             
      moduleElements.push(element);                        
      modules.push((match[2] || '').replace(/\s+/g, ',')); 

  } else {                                                 

Is the class important? I'm a newbie in angular, but as far as I know the class is not used to glue the controllers nor the modules. Should I keep it or remove it?

@derekdowling
Copy link
Contributor

Do we know why exactly this happens? I'm running into the same issue and need to solve it ASAP.

@luisperezphd
Copy link
Owner

Hey Derek, I'm not sure what you are referring to.

On Thu, Aug 13, 2015 at 5:30 PM, Derek Dowling [email protected]
wrote:

Do we know why exactly this happens? I'm running into the same issue and
need to solve it ASAP.


Reply to this email directly or view it on GitHub
#2 (comment).

@luisperezphd
Copy link
Owner

Hey everyone, I'm sorry I'm just getting familiar with GitHub was not aware of this "conversation" section. Can you provide an example of the issue. A JSFiddle for example stripped down to the core problem so I can recreate and really understand the issue.

@derekdowling
Copy link
Contributor

So this appears to be where the check was introduced: angular/angular.js#3411. I'm still trying to figure out what reproduces it on my end.

@revington
Copy link
Author

I've got this problem in the past. Solved with this patch and never faced the issue again. Since the PR was never merged I've been using my fork until today.

@alex-LE
Copy link

alex-LE commented Sep 4, 2015

I had the same problem, i''m using your fork now revington, thanks!

@revington
Copy link
Author

@alex-LE My branch is outdated but it works for me in production.
@luisperezphd this is not just a conversation but also a pull request. What is that? it means I have submitted a patch for your code. As the owner of this project you can accept it if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants