Skip to content

Instantly share code, notes, and snippets.

@AlexanderKozhevin
Last active June 6, 2016 21:19
Show Gist options
  • Save AlexanderKozhevin/3995583a11d252c7e2a81edbb972268f to your computer and use it in GitHub Desktop.
Save AlexanderKozhevin/3995583a11d252c7e2a81edbb972268f to your computer and use it in GitHub Desktop.
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