Files
2016-05-04 17:13:26 -06:00

87 lines
3.0 KiB
HTML

<ion-toolbar><ion-title>Checkboxes</ion-title></ion-toolbar>
<ion-content>
<form (submit)="doSubmit($event)" [ngFormModel]="fruitsForm">
<ion-list>
<ion-item>
<ion-label>Apple, ngControl</ion-label>
<ion-checkbox ngControl="appleCtrl"></ion-checkbox>
</ion-item>
<ion-item>
<ion-label>Banana, ngControl</ion-label>
<ion-checkbox ngControl="bananaCtrl"></ion-checkbox>
</ion-item>
<ion-item>
<ion-label>Cherry, ngControl, disabled</ion-label>
<ion-checkbox disabled="true" ngControl="cherryCtrl"></ion-checkbox>
</ion-item>
<ion-item>
<ion-label>Grape, ngControl, checked, disabled</ion-label>
<ion-checkbox [checked]="grapeChecked" [disabled]="grapeDisabled" ngControl="grapeCtrl"></ion-checkbox>
</ion-item>
<ion-item>
<ion-label>Kiwi, (change) Secondary color</ion-label>
<ion-checkbox secondary (change)="kiwiChange($event)"></ion-checkbox>
</ion-item>
<ion-item>
<ion-label>Strawberry, (change) [checked]="true"</ion-label>
<ion-checkbox light (change)="strawberryChange($event)" [checked]="true"></ion-checkbox>
</ion-item>
<ion-item>
<ion-label>Checkbox right, checked, really long text that should ellipsis</ion-label>
<ion-checkbox item-right danger checked></ion-checkbox>
</ion-item>
<button ion-item detail-none>
<ion-label>Checkbox right side</ion-label>
<ion-checkbox item-right checked></ion-checkbox>
</button>
<button ion-item detail-none>
Button w/ right side default icon, really long text that should ellipsis
<ion-icon name="information-circle" item-right></ion-icon>
</button>
</ion-list>
</form>
<p aria-hidden="true" text-center>
<button (click)="toggleGrapeChecked()" outline small class="e2eGrapeChecked">Grape Checked</button>
<button (click)="toggleGrapeDisabled()" outline small class="e2eGrapeDisabled">Grape Disabled</button>
<button (click)="doSubmit($event)" outline small class="e2eSubmit">Submit</button>
</p>
<p>
<ion-checkbox [(ngModel)]="standAloneChecked"></ion-checkbox>
Stand-alone checkbox: {{standAloneChecked}}
</p>
<p aria-hidden="true" padding>
<code>appleCtrl.dirty: {{fruitsForm.controls.appleCtrl.dirty}}</code><br>
<code>appleCtrl.value: {{fruitsForm.controls.appleCtrl.value}}</code><br>
<code>bananaCtrl.dirty: {{fruitsForm.controls.bananaCtrl.dirty}}</code><br>
<code>bananaCtrl.value: {{fruitsForm.controls.bananaCtrl.value}}</code><br>
<code>cherry.dirty: {{fruitsForm.controls.cherryCtrl.dirty}}</code><br>
<code>cherry.value: {{fruitsForm.controls.cherryCtrl.value}}</code><br>
<code>grape.dirty: {{fruitsForm.controls.grapeCtrl.dirty}}</code><br>
<code>grape.value: {{fruitsForm.controls.grapeCtrl.value}}</code><br>
<code>kiwiValue: {{kiwiValue}}</code><br>
<code>strawberryValue: {{strawberryValue}}</code><br>
</p>
<pre aria-hidden="true" padding>{{formResults}}</pre>
</ion-content>