📜  AngularJS | HTML DOM

📅  最后修改于: 2021-05-13 18:58:09             🧑  作者: Mango

ng-show和ng-hide指令:
这两个指令均用于显示隐藏HTML元素。它取决于指令的值。值为“ true”“ false”

示例1:




  

    
        
                         

              GeeksforGeeks

                                      

GeeksforGeeks

                                      

ng-hide is true

                                      

              A Computer Science Portal For Geeks

        
    
  

输出:

禁用ng的指令:
它禁用HTML元素的属性。它将数据绑定到禁用的HTML元素的属性。
示例2:




  

    
        

GeeksforGeeks

        
            

                             

            

                               Button             

            

                {{ mySwitch }}             

        
    
  

输出: