Skip to content

Commit 7e3eb23

Browse files
committed
test(select): ngFor ion-option w/ array of numbers
Related: #5495
1 parent 098371a commit 7e3eb23

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

ionic/components/select/test/single-value/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
import {NgFor} from 'angular2/common';
2+
13
import {App, Page} from '../../../../../ionic/ionic';
24

35

46
@Page({
5-
templateUrl: 'main.html'
7+
templateUrl: 'main.html',
8+
directives: [NgFor]
69
})
710
class E2EPage {
811
musicAlertOpts;
@@ -12,6 +15,7 @@ class E2EPage {
1215
music: string;
1316
month: string;
1417
year: string;
18+
years: Array<number>;
1519

1620
constructor() {
1721
this.gaming = '';
@@ -20,6 +24,8 @@ class E2EPage {
2024
this.month = '12';
2125
this.year = '1994';
2226

27+
this.years = [1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999];
28+
2329
this.musicAlertOpts = {
2430
title: '1994 Music',
2531
subTitle: 'Select your favorite'

ionic/components/select/test/single-value/main.html

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,7 @@
6767
<ion-option value="12">December</ion-option>
6868
</ion-select>
6969
<ion-select [(ngModel)]="year">
70-
<ion-option>1989</ion-option>
71-
<ion-option>1990</ion-option>
72-
<ion-option>1991</ion-option>
73-
<ion-option>1992</ion-option>
74-
<ion-option>1993</ion-option>
75-
<ion-option>1994</ion-option>
76-
<ion-option>1995</ion-option>
77-
<ion-option>1996</ion-option>
78-
<ion-option>1997</ion-option>
79-
<ion-option>1998</ion-option>
80-
<ion-option>1999</ion-option>
70+
<ion-option *ngFor="#yr of years">{{yr}}</ion-option>
8171
</ion-select>
8272
</ion-item>
8373

0 commit comments

Comments
 (0)