Skip to content

Latest commit

 

History

History
59 lines (37 loc) · 1.09 KB

data-checkbox.md

File metadata and controls

59 lines (37 loc) · 1.09 KB

<- Back to Table of Contents

data-checkbox

Usage

Given the JSON data:

{
    user: {
        agree: false
    }
}

Use the following markup to create a two-way binding with a checkbox:

<input type="checkbox" is="data-checkbox" model="{{user.agree}}" id="cbAgree"> 
<label for="cbAgree">I agree to the bogus <a href="#">Terms of service</a>.</label>

Properties

  • model: Boolean

Properties inherited from DataElementBehaviors.Basic:

  • error: String
  • name: String
  • valid: Boolean

*All other HTML5 properties.

Methods

Methods inherited from DataElementBehaviors.Basic:

  • addValidator(validatorFn, errorMessage)
  • on(eventName, handlerFn)
  • setValidity(isValid, errorMessage)
  • validate()

*All other HTML5 methods.

Events

Events inherited from DataElementBehaviors.Basic:

  • data-element-added
  • validation

*All other HTML5 events.

Behaviors