Hi,

In the code below, I define a simple directive that translates to the HTML 
snippet '<p>blabla</p>. If I use that directive twice in a row (see HTML 
body below), only the first one shows up, the second instance is ignored. 
Why is that?

Thanks and Kind Regards,
Boris

<html>                                                                     
                                                                            
     
<head>                                                                     
                                                                            
     
<script src="js/angular.js"></script>                                       
                                                                            
    
                                                                            
                                                                            
    
<script>                                                                   
                                                                            
     
  var vcapp = angular.module('testdirective', []);                         
                                                                            
     
  vcapp.directive('baBoom', function() {                                   
                                                                            
     
  return {                                                                 
                                                                            
     
    restrict: 'E',                                                         
                                                                            
     
    template:'<p>blabla</p>' ,                                             
                                                                         
    link: function(scope, elem, attr) {                                     
                                                                            
    
      console.log('my test directive', scope, elem, attr);                 
                                                                            
     
    }                                                                       
                                                                            
    
   }                                                                       
                                                                            
     
  });                                                                       
                                                                            
    
                                                                            
                                                                            
    
  angular.bootstrap(document, ['testdirective']);                           
                                                                            
    
                                                                            
                                                                            
    
</script>                                                                   
                                                                            
    
                                                                            
                                                                            
    
</head>                                                                     
                                                                            
    
<body ng-app='testdirective'>                                               
                                                                            
    
<h1>Test Directive</h1>                                                     
                                                                            
    
<ba-boom/>                                                                 
                                                                            
     
<ba-boom/>                                                                 
                                                                            
     
</body>                                                                     
                                                                            
    
</html>                                                                     
                                                                            
    
           

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to