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:
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' });
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
Post a Comment