Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fear(checkbox): adds support for ng-checked to checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Messerle committed Feb 6, 2015
1 parent d70094d commit 6c7734e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/checkbox/checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ function MdCheckboxDirective(inputDirective, $mdInkRipple, $mdAria, $mdConstant,
var checked = false;
$mdTheming(element);

if (attr.ngChecked) {
scope.$watch(
scope.$eval.bind(scope, attr.ngChecked),
ngModelCtrl.$setViewValue.bind(ngModelCtrl)
);
}

$mdAria.expectWithText(element, 'aria-label');

// Reuse the original input[type=checkbox] directive from Angular core.
Expand Down

3 comments on commit 6c7734e

@robertmesserle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well... that commit message is certainly more dramatic than intended...

@robertmesserle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closes #535.

@tkrotoff
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is missing a unit test.

Please sign in to comment.