Show or Hide Menu List via ng-show

3358 단어 list
<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>

좋은 웹페이지 즐겨찾기