javascript - Bootstrap Dropdown + Angular data-ng-repeat -



javascript - Bootstrap Dropdown + Angular data-ng-repeat -

i'm having little issue while trying show info (villains/villanos) in drop downwards ng-repeat. i've been looking around , trying can't create work. have next html:

class="lang-html prettyprint-override"><script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.7/angular.min.js" </script> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.7/angular-animate.js"></script> <script> // function lets dropdown button save name of villain it's selected. $(function(){ $(".dropdown-menu li a").click(function(){ $(".dropdown-toggle:first-child").text($(this).text()); $(".dropdown-toggle:first-child").val($(this).text()); }); }); </script> <div class="dropdown"> <button class="btn btn-default dropdown-toggle dropdown-suspects-sides" type="button" id="dropdownmenu1" data-toggle="dropdown"> suspects <span class="caret"></span> </button> <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownmenu1"> <li class="suspect" role="presentation" data-ng-repeat = "villain in villains"> <a role="menuitem" tabindex="-1" href="#"> <span class="glyphicon glyphicon-user"></span> {{villain}} </a> </li> </ul> </div> /* controllers */ ... $scope.getvillains = function() { $http.get("/getvillains") .success(function(data) { $scope.villains = info } ) }; ...

as can see, i'm trying create dropdown show villains have. items appear correctly if they're showed in normal list items can "used", they're not appearing if seek show them way. i'm pretty sure i'm doing wrong here can't guess it. in advance!

javascript html angularjs twitter-bootstrap

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -