angular.module.ng.$compileProvider.directive.ng-checked

Description

The HTML specs do not require browsers to preserve the special attributes such as checked. (The presence of them means true and absence means false) This prevents the angular compiler from correctly retrieving the binding expression. To solve this problem, we introduce ng-checked.

Usage

as attribute
<INPUT ng-checked
     expression="{string}">
   ...
</INPUT>

Parameters

Example

  Check me to check both: <input type="checkbox" ng-model="master"><br/>
  <input id="checkSlave" type="checkbox" ng-checked="master">
  it('should check both checkBoxes', function() {
    expect(element('.doc-example-live #checkSlave').prop('checked')).toBeFalsy();
    input('master').check();
    expect(element('.doc-example-live #checkSlave').prop('checked')).toBeTruthy();
  });