Last active
June 6, 2016 21:19
-
-
Save AlexanderKozhevin/3995583a11d252c7e2a81edbb972268f to your computer and use it in GitHub Desktop.
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, ElementRef, OnInit, Input, Output, EventEmitter,OnChanges} from 'angular2/core'; | |
@Component({ | |
selector: 'phone', | |
template: ` | |
<input type="tel" class="phone form-control" value="{{ inputmodel }}" (keyup)="onChange($event)"> | |
` | |
}) | |
export class Phone implements OnInit { | |
@Input() inputmodel: any; | |
@Output() outputmodel: EventEmitter = new EventEmitter(); | |
ngOnInit() { | |
var that = this; | |
$(".phone").intlTelInput(); | |
} | |
onChange(event) { | |
this.outputmodel.next(event.target.value); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment