javascript - Angular-UI dropdown doesn't open -


i'm generating html javascript object. example have following object:

var e = [{'element' : 'button', 'innerhtml' : '<span class="dropdown-toggle">more<span class="caret"></span></span><ul class="dropdown-menu"><li>menu item</li></ul>',           'attrs' : {'class' : 'btn dropdown'}}]; 

and js function generates following string $scope.my_template:

<button class="btn dropdown">     <span class="dropdown-toggle">more         <span class="caret"></span>     </span>     <ul class="dropdown-menu">       <li>menu item</li>   </ul> </button> 

than i'm trying apply template html page with:

<div ng-bind-html-unsafe="my_template"> </div> 

i see dropdown button in page when i'm clicking on it, doesn't open.

i think content of my_template wrong.

i changed it, , working fine me: http://plnkr.co/edit/9vpml35wzrufkewhfup5?p=preview

now content of $scope.my_template is:

<div class="dropdown">      <button data-toggle="dropdown" class="btn dropdown-toggle" >more <span class="caret"></span></button>       <ul class="dropdown-menu" role="menu" aria-labelledby="dlabel">          <li>menu item</li>      </ul> </div>     

Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

java - More than one row with the given identifier was found: 1, for class: com.model.Diagnosis -