Last active
March 25, 2018 12:23
-
-
Save vadimkorr/5f2e845b16f2de97470990a3542392fe to your computer and use it in GitHub Desktop.
input.component.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component, Input, ViewChild, ElementRef } from '@angular/core'; | |
| @Component({ | |
| selector: 'custom-input', | |
| templateUrl: './input.component.html', | |
| styleUrls: ['./input.component.css'] | |
| }) | |
| export class InputComponent { | |
| value: string = ''; | |
| @Input() type: string = 'text'; | |
| @Input() id: string; | |
| @Input() placeholder: string = ''; | |
| @ViewChild('inputElement') private _inputElement: ElementRef; | |
| get inputElement(): ElementRef { | |
| return this._inputElement; | |
| } | |
| onChange(event: any) { } | |
| onKeyup(event: any) { } | |
| onBlur(event: any) { } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment