【发布时间】:2016-10-18 04:01:36
【问题描述】:
美好的一天。我使用了几种方法来使用 ng-show 和 ng-hide,但它们都不起作用。单击按钮时,第一个 div 应该隐藏并出现第二个。请帮帮我!这是我尝试的最后一种方式:
<div class="parentDiv .col-lg-">
<from class="centerMain">
<div ng-show="showF" class="center-block"> <!-- this div should hides -->
<div>
<label class="center-block">Введите PIN</label>
</div>
<div>
<input name="userName" placeholder="1234" class="center-block inputLine">
</div>
<div>
<button ng-click="showF = !showF" class="center-block buttonBig">Установить PIN</button> <!-- this button makes hiding -->
</div>
</div>
<div ng-show="!showF" class="center-block"> <!--this should appears -->
<div>
<label class="center-block">Подтвердите пин</label>
</div>
<div>
<input name="userName" placeholder="1234" class="center-block inputLine">
</div>
<div>
<button class="center-block buttonBig">Подтвердить</button>
</div>
</div>
</from>
</div>
【问题讨论】:
-
如果这实际上是 Angular2 则没有
ng-show、ng-hide、ng-click... -
@GünterZöchbauer 哦,原来如此。谢谢你。