Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 2.03 KB

File metadata and controls

39 lines (29 loc) · 2.03 KB

Checkbox

A basic checkbox input

Usage

<rl-checkbox ng-model="" on-toggle="" ng-disabled="" active=""> ... </rl-checkbox>

Options

Two-way binds the specified value to the checkbox 'checked' property. See ng-model.

on-toggle

This expression is triggered when the checkbox is clicked. The new value of the checked property is provided on the expression scope as value.

This option will set disabled on the checkbox if the expression inside it is truthy.

active (default: true)

If set to false, clicking on the checkbox won't trigger the state to change. This is used primarily if the checkbox is within a larger context that can be clicked to toggle to avoid toggle/untoggle behavior.

Full Example

A checkbox with an ng-model, on-toggle, and disabling.

<rl-checkbox ng-model="button.checked" on-toggle="button.click()" ng-disabled="true"> ... </rl-checkbox>

Output (When checkbox.checked is true):

<span class="rl-checkbox-checked" ng-click="checkbox.toggle()" disabled> ... </span>

Output (When checkbox.checked is false):

<span class="rl-checkbox" ng-click="checkbox.toggle()" disabled> ... </span>

(By default, rl-checkbox is styled as fa-square-o and rl-checkbox-checked is styled as fa-check-square-o