I need to toggle an element that needs to be initially visible. In my case the toggle works fine but the element (menu
class) is initially hidden...
Here is my code:
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-app>
<a href="#" class="toggle-menu" ng-click="collapsed=!collapsed">Click to toggle menu</a>
<div class="menu" ng-show="collapsed">
<ol>
<li>Item</li>
<li>Item</li>
<li>Item</li>
</ol>
</div>
</div>