【发布时间】:2016-10-10 09:06:51
【问题描述】:
我正在创建一个有四个按钮的网络应用程序
1)点击这里
2) 点击这里
3)(隐藏按钮)显示点击这里
4)(隐藏按钮)在此处显示点击
第三和第四个按钮被隐藏
我想要的是__________________
当我点击第一个按钮时,第三个按钮应该是可见的,当我点击第二个按钮时,第四个按钮应该是可见的,这是我的代码
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example - example-ng-show-production</title>
<link href="glyphicons.css" rel="stylesheet" type="text/css">
<link href="animations.css" rel="stylesheet" type="text/css">
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular-animate.js"></script>
</head>
<body ng-app="ngAnimate">
<div>
<button ng-model="clickedh">Click here</button>
<button ng-model="clickede">here click</button>
</div>
<div>
<button ng-hide="true" ng-show="clickedh">show click here</button>
<button ng-hide="true" ng-show="clickede">show here click</button>
</div>
</body>
</html>
但它不起作用我需要做什么?
【问题讨论】:
-
在第三个和第四个按钮中使用 ng-hide 或 ng-show。不要将代码“真实”。 Insted 在第一个和第二个按钮的单击事件中绑定 ng-hide 值(使用 ng-click)。这是有道理的。