mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
@ -142,7 +142,7 @@ export class RadioButton {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
if (this._group && isDefined(this._group.value) && this._group.value === this.value) {
|
if (this._group && isDefined(this._group.value) && this._group.value == this.value) {
|
||||||
this.checked = true;
|
this.checked = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -148,7 +148,7 @@ export class RadioGroup {
|
|||||||
|
|
||||||
// check this radiobutton if its value is
|
// check this radiobutton if its value is
|
||||||
// the same as the radiogroups value
|
// the same as the radiogroups value
|
||||||
radioButton.checked = (radioButton.value === this.value);
|
radioButton.checked = (radioButton.value == this.value);
|
||||||
|
|
||||||
if (radioButton.checked) {
|
if (radioButton.checked) {
|
||||||
// if this button is checked, then set it as
|
// if this button is checked, then set it as
|
||||||
@ -183,7 +183,7 @@ export class RadioGroup {
|
|||||||
remove(button: RadioButton) {
|
remove(button: RadioButton) {
|
||||||
let index = this._btns.indexOf(button);
|
let index = this._btns.indexOf(button);
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
if (button.value === this.value) {
|
if (button.value == this.value) {
|
||||||
this.value = null;
|
this.value = null;
|
||||||
}
|
}
|
||||||
this._btns.splice(index, 1);
|
this._btns.splice(index, 1);
|
||||||
|
@ -14,6 +14,7 @@ class E2EApp {
|
|||||||
items: Array<{description: string, value: any}>;
|
items: Array<{description: string, value: any}>;
|
||||||
relationship: string;
|
relationship: string;
|
||||||
pet: string;
|
pet: string;
|
||||||
|
selectedTime: number = 60;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.fruits = new Control('apple');
|
this.fruits = new Control('apple');
|
||||||
|
@ -99,7 +99,7 @@
|
|||||||
<code><b>pet:</b> {{pet}}</code>
|
<code><b>pet:</b> {{pet}}</code>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ion-list radio-group [(ngModel)]="someNumber">
|
<ion-list radio-group [(ngModel)]="someValue">
|
||||||
<ion-item *ngFor="#item of items">
|
<ion-item *ngFor="#item of items">
|
||||||
<ion-label>
|
<ion-label>
|
||||||
{{ item.description }}
|
{{ item.description }}
|
||||||
@ -110,7 +110,21 @@
|
|||||||
</ion-list>
|
</ion-list>
|
||||||
|
|
||||||
<div padding>
|
<div padding>
|
||||||
<code><b>someNumber:</b> {{someNumber}}</code>
|
<code><b>someValue:</b> {{someValue}}</code>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<ion-list radio-group [(ngModel)]="selectedTime">
|
||||||
|
<ion-list-header>
|
||||||
|
Time
|
||||||
|
</ion-list-header>
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>60 minutes</ion-label>
|
||||||
|
<ion-radio value="60"></ion-radio>
|
||||||
|
</ion-item>
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>30 minutes</ion-label>
|
||||||
|
<ion-radio value="30"></ion-radio>
|
||||||
|
</ion-item>
|
||||||
|
</ion-list>
|
||||||
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
Reference in New Issue
Block a user