mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
docs(checkbox): add advanced example
Add an example for how to do a function call when checkbox changed
This commit is contained in:

committed by
Mike Hartington

parent
d86785c376
commit
3323275ddd
@ -42,6 +42,34 @@ import { Item } from '../item/item';
|
||||
* </ion-list>
|
||||
* ```
|
||||
*
|
||||
* @advanced
|
||||
*
|
||||
* ```html
|
||||
*
|
||||
* <!-- Call function when state changes -->
|
||||
* <ion-list>
|
||||
*
|
||||
* <ion-item>
|
||||
* <ion-label>Cucumber</ion-label>
|
||||
* <ion-checkbox [(ngModel)]="cucumber" (ionChange)="updateCucumber()"></ion-checkbox>
|
||||
* </ion-item>
|
||||
*
|
||||
* </ion-list>
|
||||
* ```
|
||||
*
|
||||
* ```ts
|
||||
* @Component({
|
||||
* templateUrl: 'main.html'
|
||||
* })
|
||||
* class SaladPage {
|
||||
* cucumber: boolean;
|
||||
*
|
||||
* updateCucumber() {
|
||||
* console.log("Cucumbers new state:" + this.cucumber);
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @demo /docs/demos/src/checkbox/
|
||||
* @see {@link /docs/components#checkbox Checkbox Component Docs}
|
||||
*/
|
||||
|
Reference in New Issue
Block a user