From ece5047b6c0f68e3411040635b72a14dceb06d9f Mon Sep 17 00:00:00 2001 From: Dan Bucholtz Date: Thu, 2 Mar 2017 14:50:07 -0600 Subject: [PATCH] refactor(input): restructure input component to separate modules restructure input component to separate modules --- src/components/input/input.ts | 3 ++- src/components/input/native-input.ts | 18 ------------------ src/components/input/next-input.ts | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 19 deletions(-) create mode 100644 src/components/input/next-input.ts diff --git a/src/components/input/input.ts b/src/components/input/input.ts index 1bfb3f36da..d258727600 100644 --- a/src/components/input/input.ts +++ b/src/components/input/input.ts @@ -10,7 +10,8 @@ import { Form, IonicFormInput } from '../../util/form'; import { Ion } from '../ion'; import { isString, isTrueProperty } from '../../util/util'; import { Item } from '../item/item'; -import { NativeInput, NextInput } from './native-input'; +import { NativeInput } from './native-input'; +import { NextInput } from './next-input'; import { NavController } from '../../navigation/nav-controller'; import { NavControllerBase } from '../../navigation/nav-controller-base'; import { Platform } from '../../platform/platform'; diff --git a/src/components/input/native-input.ts b/src/components/input/native-input.ts index 351432b72c..31775a4ef1 100644 --- a/src/components/input/native-input.ts +++ b/src/components/input/native-input.ts @@ -240,21 +240,3 @@ function removeClone(plt: Platform, srcNativeInputEle: HTMLElement) { (srcNativeInputEle.style)[plt.Css.transform] = ''; srcNativeInputEle.style.opacity = ''; } - - -/** - * @private - */ -@Directive({ - selector: '[next-input]' -}) -export class NextInput { - @Output() focused: EventEmitter = new EventEmitter(); - - @HostListener('focus') - receivedFocus() { - console.debug('native-input, next-input received focus'); - this.focused.emit(true); - } - -} diff --git a/src/components/input/next-input.ts b/src/components/input/next-input.ts new file mode 100644 index 0000000000..45b2f04e0f --- /dev/null +++ b/src/components/input/next-input.ts @@ -0,0 +1,18 @@ +import { Directive, EventEmitter, HostListener, Output } from '@angular/core'; + +/** + * @private + */ +@Directive({ + selector: '[next-input]' +}) +export class NextInput { + @Output() focused: EventEmitter = new EventEmitter(); + + @HostListener('focus') + receivedFocus() { + console.debug('native-input, next-input received focus'); + this.focused.emit(true); + } + +}