Looking to trigger the dropdown opening when a link is clicked using AngularJS. My approach was to use the ng-class directive to add the 'open' class to the dropdown, but it doesn't seem to be working.
I have two dropdown menus, and what I want is for the second one to open when the link in the first one is clicked.
<ul class="nav navbar-nav navbar-right " >
<li class="dropdown" ng-class="myDropdown ? : 'open'">
<a class="dropdown-toggle" data-toggle="dropdown" >Menu</a>
<ul class="dropdown-menu " role="menu" ng-if="!myDropdown">
<li>
<a href="" ng-click="toogleDropDown()">Open second dropdown</a>
</li>
</ul>
<ul class="dropdown-menu " role="menu" ng-if="myDropdown">
<li >
<a href="" ng-click="toogleDropDown()">Go back</a>
</li>
</ul>
</li>
</ul>
Typescript
function toogleDropDown() {
this.scope.myDropdown = true;
}