javascript - ng-repeat gets commented out by Drop.js -


i'm trying make dropdown menu using drop.js , angular.js. when try use ng-repeat directive inside content element defined drop.js, ng-repeat element commented out reason (see screenshot below). knows why happens , what's way solve problem?

screenshot of dom:

enter image description here

i error in console:

typeerror: cannot read property 'insertbefore' of null

here's html code:

<div id="dropdownmenu">     dropdown menu <i class="fa fa-caret-down"></i> </div>  <div id="dropdownmenu-content">   <div>line 1 works fine.</div>   <div>line 2 works fine too.</div>   <div>but lines in ng-repeat not showing up!</div>     <div ng-repeat="l in ['line 1', 'line 2', 'line 3']">             {{l}}     </div> </div> 

my javascript code:

var drop = new drop({       target: document.queryselector('#dropdownmenu'),       content: document.queryselector('#dropdownmenu-content'),       position: 'bottom left',       openon: 'click'     }); 

here's plunker demo of problem.

you'd better bind drop module after angular directive ng-repeat render over.

 angular.module('select', [])     .controller('selectcontroller', ['$scope','$timeout', function($scope,$timeout) {        $timeout(function(){         var drop = new drop({            target: document.queryselector('#dropdownmenu'),            content: document.queryselector('#dropdownmenu-content'),            position: 'bottom left',            openon: 'click'         });       },0);  }]); 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -