当前位置: 首页 > 工具软件 > ng-animate > 使用案例 >

AngularJS的学习--ng-show/ng-hide/ng-if和ng-switch

龙星渊
2023-12-01

 angularJS 在模板里判断属性后显示相应html怎么写? 
{
<!doctype html>
<html ng-app>
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/angular.min.js"></script>
    <script type="text/javascript">
        var DemoCtrl = function($scope){           
            $scope.ShowMode = "list";
 
            $scope.ChangeShow = function(ShowMode){
                $scope.ShowMode = ShowMode;
            }
        };
    </script>
</head>
<body ng-controller="DemoCtrl" ng-switch="ShowMode">

以上是摘要
博客已搬家地址:AngularJS的学习--ng-show/ng-hide/ng-if和ng-switch

 类似资料: