From 6de91fcc883e1cfa19c700605cc9b9d376016d51 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Thu, 13 Oct 2016 23:29:43 +0200 Subject: [PATCH] test(input): adds events test --- .../input/test/events/app-module.ts | 63 +++++++++++++++++++ src/components/input/test/events/e2e.ts | 1 + src/components/input/test/events/main.html | 50 +++++++++++++++ 3 files changed, 114 insertions(+) create mode 100644 src/components/input/test/events/app-module.ts create mode 100644 src/components/input/test/events/e2e.ts create mode 100644 src/components/input/test/events/main.html diff --git a/src/components/input/test/events/app-module.ts b/src/components/input/test/events/app-module.ts new file mode 100644 index 0000000000..c768ec1988 --- /dev/null +++ b/src/components/input/test/events/app-module.ts @@ -0,0 +1,63 @@ +import { Component, NgModule } from '@angular/core'; +import { IonicApp, IonicModule, TextInput } from '../../../..'; + + +@Component({ + templateUrl: 'main.html' +}) +export class E2EPage { + ngvalue1: any; + ngvalue2: any; + value2: any; + value3: any; + value4: any; + value5: any; + value6: any; + + input2() { + this.value2 = this.ngvalue2; + console.log('value2', this.value2); + } + + input3(ref: TextInput) { + this.value3 = ref.value; + console.log('value3', this.value3); + } + + input4(value: string) { + this.value4 = value; + console.log('value4', this.value4); + } + + input5(ev: any) { + this.value5 = ev.target.value; + console.log('value5', this.value5); + } + + input6(value: string) { + this.value6 = value; + console.log('value6', this.value6); + } +} + +@Component({ + template: '' +}) +export class E2EApp { + rootPage = E2EPage; +} + +@NgModule({ + declarations: [ + E2EApp, + E2EPage + ], + imports: [ + IonicModule.forRoot(E2EApp) + ], + bootstrap: [IonicApp], + entryComponents: [ + E2EPage + ] +}) +export class AppModule {} diff --git a/src/components/input/test/events/e2e.ts b/src/components/input/test/events/e2e.ts new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/src/components/input/test/events/e2e.ts @@ -0,0 +1 @@ + diff --git a/src/components/input/test/events/main.html b/src/components/input/test/events/main.html new file mode 100644 index 0000000000..853a915624 --- /dev/null +++ b/src/components/input/test/events/main.html @@ -0,0 +1,50 @@ + + + + Inline Label Text Input + + + + + + + + + + NgModel: {{ngvalue1}} + + + + + #Reference.value: {{inputRef0.value}} + + + + + NgModel + (input): {{value2}} + + + + + #Reference + (input): {{value3}} + + + + + #Reference.value + (input): {{value4}} + + + + + (input) + event: {{value5}} + + + + + (input) + event.target.value: {{value6}} + + + + + +