fix(ionCheckbox): make ng-checked and ng-change work

Closes #1349. Closes #1361

BREAKING CHANGE: ion-checkbox no longer has an isolate scope.

This will break your checkbox only if you were relying upon the
checkbox having an isolate scope: if you were referencing
`$parent.value` as the ng-disabled attribute, for example.

Change your code from this:

```html
<ion-checkbox ng-disabled="{{$parent.isDisabled}}"></ion-checkbox>
```

To this:

```html
<ion-checkbox ng-disabled="{{isDisabled}}"></ion-checkbox>
```
This commit is contained in:
Andrew Joslin
2014-05-13 07:09:01 -06:00
parent 07da4ced2e
commit a006d89612
3 changed files with 41 additions and 20 deletions

View File

@@ -17,6 +17,12 @@
<div ng-controller="TestCtrl">
<div class="list">
<ion-checkbox ng-model="checkModel" ng-change="myChange = checkModel">
Main Check
</ion-checkbox>
<ion-checkbox ng-checked="myChange">
Follows ng-change of Main Check
</ion-checkbox>
<ion-toggle ng-model="myModel" ng-disabled="isDisabled">myModel ({{!!myModel}})</ion-toggle>
<ion-toggle ng-model="catModel" ng-disabled="isDisabled" ng-true-value="cats" ng-false-value="dogs">Cats or dogs? ({{catModel}})</ion-toggle>
<ion-toggle ng-model="isDisabled">Disable myModel ({{!!isDisabled}})</ion-toggle>