简体   繁体   English

如何在单击“x”按钮时关闭面板并使用angularjs单击屏幕?(新到角度)

[英]How do I close the panel when clicked on 'x' button and click on the screen using angularjs?(new to angular)

Here is my HTML code for my button 这是我的按钮的HTML代码

  <button class="btn btn-outlined  " ng-click="vm.showCommentBox1()">Notify All</button>
    <div class="comment-box custom saveAll" ng-if=""><div class="panel panel-default">
                  <div class="panel-heading">
                    <button type="button" class="close" aria-label="Close" ng-click="comment=true" title="Close comment box"><span aria-hidden="true">×</span>
                      </button>
                    <h3 class="panel-title blue-30">Comment</h3>
                  </div>
                  <div class="panel-body">
                    <form>
                      <div class="form-group">
                        <textarea class="form-control bg-white" ng-model=""
                          placeholder="Add your description"></textarea>
                      </div>
                    </form>
                  </div>
                </div>
              </div>     

so when i click the 'x' button the panel should get closed 所以当我点击“x”按钮时,面板应该关闭

只需在所需元素上使用ng-if="comment===true" ,以便在通过按“x”按钮将注释设置为true时删除元素。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 单击外部区域时如何关闭滑动面板? - How do I make my sliding panel close when the area outside it is clicked? 单击按钮时如何忽略div单击? - how do I ignore div click when button is clicked? 当使用angularjs和Bootstrap在HTML5页面的屏幕上单击TAB时,如何从字段输入值中删除空格 - How do I remove spaces from a field input value when TAB is clicked on the screen on a HTML5 page using angularjs and Bootstrap 单击新按钮时如何关闭所有其他 div? - How to close all other divs when a new button is clicked? 每次单击 angular 按钮时,如何关闭已打开的窗口,然后打开一个新窗口? - How can i close an already opened window and then open a new window every time i click a button in angular? 单击任何地方关闭菜单; 单击任何位置时如何使其停止打开 - click anywhere close menu; how do I make it stop opening when clicked anywhere 单击时如何关闭按钮(X)? - How to close button (X) on click? 如何使用angularjs多次单击按钮时添加新字段 - How to add new field when button is clicked multiple times by using angularjs 使用角4外部单击时如何关闭弹出屏幕? - how to close pop screen when use click outside in angular 4? 使用jQuery单击按钮时,如何显示幻灯片? - How do I display a slideshow when a button is clicked using jQuery?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM