Skip to content

Commit 6de91fc

Browse files
committed
test(input): adds events test
1 parent d618ea2 commit 6de91fc

File tree

3 files changed

+114
-0
lines changed

3 files changed

+114
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import { Component, NgModule } from '@angular/core';
2+
import { IonicApp, IonicModule, TextInput } from '../../../..';
3+
4+
5+
@Component({
6+
templateUrl: 'main.html'
7+
})
8+
export class E2EPage {
9+
ngvalue1: any;
10+
ngvalue2: any;
11+
value2: any;
12+
value3: any;
13+
value4: any;
14+
value5: any;
15+
value6: any;
16+
17+
input2() {
18+
this.value2 = this.ngvalue2;
19+
console.log('value2', this.value2);
20+
}
21+
22+
input3(ref: TextInput) {
23+
this.value3 = ref.value;
24+
console.log('value3', this.value3);
25+
}
26+
27+
input4(value: string) {
28+
this.value4 = value;
29+
console.log('value4', this.value4);
30+
}
31+
32+
input5(ev: any) {
33+
this.value5 = ev.target.value;
34+
console.log('value5', this.value5);
35+
}
36+
37+
input6(value: string) {
38+
this.value6 = value;
39+
console.log('value6', this.value6);
40+
}
41+
}
42+
43+
@Component({
44+
template: '<ion-nav [root]="rootPage"></ion-nav>'
45+
})
46+
export class E2EApp {
47+
rootPage = E2EPage;
48+
}
49+
50+
@NgModule({
51+
declarations: [
52+
E2EApp,
53+
E2EPage
54+
],
55+
imports: [
56+
IonicModule.forRoot(E2EApp)
57+
],
58+
bootstrap: [IonicApp],
59+
entryComponents: [
60+
E2EPage
61+
]
62+
})
63+
export class AppModule {}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<ion-header>
2+
3+
<ion-toolbar>
4+
<ion-title>Inline Label Text Input</ion-title>
5+
</ion-toolbar>
6+
7+
</ion-header>
8+
9+
10+
<ion-content>
11+
<ion-list>
12+
13+
<ion-item>
14+
<ion-label stacked>NgModel: {{ngvalue1}}</ion-label>
15+
<ion-input [(ngModel)]="ngvalue1"></ion-input>
16+
</ion-item>
17+
18+
<ion-item>
19+
<ion-label stacked>#Reference.value: {{inputRef0.value}}</ion-label>
20+
<ion-input #inputRef0></ion-input>
21+
</ion-item>
22+
23+
<ion-item>
24+
<ion-label stacked>NgModel + (input): {{value2}}</ion-label>
25+
<ion-input [(ngModel)]="ngvalue2" (input)="input2()"></ion-input>
26+
</ion-item>
27+
28+
<ion-item>
29+
<ion-label stacked>#Reference + (input): {{value3}}</ion-label>
30+
<ion-input #inputRef1 (input)="input3(inputRef1)"></ion-input>
31+
</ion-item>
32+
33+
<ion-item>
34+
<ion-label stacked>#Reference.value + (input): {{value4}}</ion-label>
35+
<ion-input #inputRef2 (input)="input4(inputRef2.value)"></ion-input>
36+
</ion-item>
37+
38+
<ion-item>
39+
<ion-label stacked>(input) + event: {{value5}}</ion-label>
40+
<ion-input (input)="input5($event)"></ion-input>
41+
</ion-item>
42+
43+
<ion-item>
44+
<ion-label stacked>(input) + event.target.value: {{value6}}</ion-label>
45+
<ion-input (input)="input6($event.target.value)"></ion-input>
46+
</ion-item>
47+
48+
</ion-list>
49+
50+
</ion-content>

0 commit comments

Comments
 (0)