Show or Hide Menu List via ng-show

<div ng-app ng-controller='MenuController'>
    <ul ng-show='menuState_show'>
        <li>Stun</li>
        <li>Disintegrate</li>
        <li>Erase from history</li>
    </ul>
    <button ng-click='toggleMenu()'>Toggle Menu</button>
</div>

<script src="~/Scripts/angular.js"></script>
<script>
    function MenuController($scope) {
        $scope.menuState_show = false;
        $scope.toggleMenu = function () {
            $scope.menuState_show = !$scope.menuState_show;
        };
    }
</script>
posted @ 2014-06-22 18:09  PengpengSong  阅读(205)  评论(0编辑  收藏  举报