Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Como integrar o pugin no angular 2? #598

Closed
diegoserrat opened this issue Aug 23, 2017 · 4 comments
Closed

Como integrar o pugin no angular 2? #598

diegoserrat opened this issue Aug 23, 2017 · 4 comments

Comments

@diegoserrat
Copy link

Boa tarde!

Eu gostaria de saber se é possível integrar o plugin com o angular 2?
Sou iniciante e não achei nada sobre isso.

Obrigado!

@straube
Copy link

straube commented Aug 23, 2017

Have you tried this? #499

@diegoserrat
Copy link
Author

Hmm, I've take a look on this but as I said I'm a beginner.
I don't know how to "translate" this directive to a angular 2 directive, if you have a "tutorial" I could use it.
I didn't found any one :/

@rodolfojnn
Copy link

Você precisa criar uma diretiva no elemento input.

No construtor da diretiva faço a injeção do ElementRef, e no AfterViewInit chamo o plugin jquery normalmente.

constructor(public el: ElementRef) { }

  ngAfterViewInit() {
    (<any>$(this.el.nativeElement)).mask('00.000.000/0000-00');
  }

@paulosouzainfo
Copy link

Use a jQuery trick using "on" like this...
$(document).on('keyup', '.bornDate', function() {
$(this).mask('0000-00-00');
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants