-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Feature request: mask texts without an selector (AngularJS) #306
Comments
JQuery Mask works with text elements too. There is some examples at our home page. []'s
|
Right, but it works without an element like my example? |
Essentially, nothing will work without an selector. Everything depends upon it. []'s
|
The function that I mentioned can be easily changed to work without selectors... |
@sergiomichels I know that :-) I'm just explaining why it will not work without an selector. This should be implemented because it's not ready to work without an selector. This feature should be well designed so don't need to hurry ;-) |
Ok, got it! My hurry is to not duplicate code or customize it in the project without really needing. Nothing good comes with some hidden customized code that a few knows |
Sure, what we need to have in mind is that it should be generic, relying only on jQuery and vanilla javascript behaviours...never specifically related or dependent on a angular or any other framework. You should probably know that I'm just being as much clear as possible 👍 |
Yes, Angular is just an example of use case and the mask plugin should not depend on it. My final suggestion ($.masked) could be used by anyone. |
+1 for this feature. As a hack, I have made:
|
I have the same problem too, it's not only about Angular. I need to do this workarround:
To mask only bind to the element inside
And this exemple:
will bind to all Another workaround is too disable
Before angular stuffs. Also, Angular's core works on jQuery, so, all elements on Angular if jQuery is available are also a jQuery element and supports jQuery plugins too. |
FYI -I happened to do it in the following way in my angular application.. PS: In my case, element was input type. |
Guys: Also... the method Any other example on alternatives on how to integrate it would be appreciated. |
@igorescobar Your example is just for directives, and with this type of component it plays nice. My request was for filters, when I do not have an instance of an element. |
It would be nice to be able to mask not only inputs but also texts. This is a good feature to use when this plugin is integrated with AngularJS filters, for example:
2023490090 | mask: '000.000.000-00'
This can be accomplished by adapting the
getMasked
method to accept text values. The jQuery usage could be$.masked(2023490090, '000.000.000-00')
I will try to reserve some time this week to make a pull request :-)
The text was updated successfully, but these errors were encountered: