如何使用AngularJS显示和隐藏div?不使用任何CSS或jQuery [英] How to Show and Hide div using AngularJS? without using any css or jquery
本文介绍了如何使用AngularJS显示和隐藏div?不使用任何CSS或jQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想隐藏一个div并使用angularJS在单击按钮时显示它吗? 我使用了ng-show和ng-hide,但是它不起作用
I want to hide a div and show it on button click using angularJS? I used ng-show and ng-hide but it's not working
推荐答案
<div ng-show="anyVariable"></div>
<button ng-click="anyVariable = !anyVariable">Click</button>
这篇关于如何使用AngularJS显示和隐藏div?不使用任何CSS或jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文