AngularJS toggle button

前端 未结 6 1136
不知归路
不知归路 2021-02-01 03:41

I am trying to create a toggle button in Angular. What I have so far is:


      
6条回答
  •  北恋
    北恋 (楼主)
    2021-02-01 04:22

    It might help you:

    
    
    
      
      
      
    
    
    
      

    Hello World!

    function MyCtrl($scope) {
      $scope.visible = true;
      $scope.toggle = function() {
        $scope.visible = !$scope.visible;
      };
    }
    

提交回复
热议问题