Files
2015-09-18 21:58:44 -05:00

55 lines
1.9 KiB
HTML

<ion-toolbar><ion-title>Switches</ion-title></ion-toolbar>
<ion-content>
<form (submit)="doSubmit($event)" [ng-form-model]="fruitsForm">
<ion-list>
<ion-switch value="apple" checked="true" ng-control="appleCtrl" id="e2eAppleCheckbox">
Apple, value=apple, init checked
</ion-switch>
<ion-switch ng-control="bananaCtrl">
Banana, init no checked/value attributes
</ion-switch>
<ion-switch value="cherry" disabled="true" ng-control="cherryCtrl">
Cherry, value=cherry, init disabled
</ion-switch>
<ion-switch value="grape" [checked]="grapeChecked" [disabled]="grapeDisabled" ng-control="grapeCtrl">
Grape, value=grape, init checked, disabled
</ion-switch>
<ion-switch secondary checked="true">
Secondary color
</ion-switch>
</ion-list>
</form>
<p aria-hidden="true" class="align-center">
<button (click)="toggleGrapeChecked()" outline small id="e2eGrapeChecked">Grape Checked</button>
<button (click)="toggleGrapeDisabled()" outline small id="e2eGrapeDisabled">Grape Disabled</button>
<button (click)="doSubmit($event)" outline small id="e2eSubmit">Submit</button>
</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>
</p>
<pre aria-hidden="true" padding>{{formResults}}</pre>
</ion-content>