📜  角材料-开关

📅  最后修改于: 2020-10-28 05:00:57             🧑  作者: Mango


md-switch是Angular指令,用于显示开关。

属性

下表列出了md-switch的不同属性的参数和说明。

Sr.No Parameter & Description
1

* ng-model

The assignable angular expression to data-bind to.

2

name

The property name of the form under which the control is published.

3

ng-true-value

The value to which the expression should be set when selected.

4

ng-false-value

The value to which the expression should be set when not selected.

5

ng-change

The Angular expression to be executed when input changes due to user interaction with the input element.

6

ng-disabled

En/Disable based on the expression.

7

md-no-ink

The use of attribute indicates the use of ripple ink effects.

8

aria-label

This publishes the button label used by the screen-readers for accessibility. This defaults to the switch’s text.

以下示例显示了md-swipe- *的用法以及滑动组件的用法。

am_switches.htm


      
      
      
      
      
      
      
            
   
   
    
      
Switch 1: {{ data.switch1 }} Switch 2 (md-warn): {{ data.switch2 }} Switch 3 (Disabled) Switch 4 (Disabled, Active) Switch 5 (md-primary): No Ink Switch 6 : {{ message }}

结果

验证结果。