-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
text-field should support input filters #151
Comments
Sorry to hear that you're seeing an error. Can you provide a Plunker so I $parse is a built-in Angular service so I'm not sure that a dependency is On Monday, August 3, 2015, EnterpriseDT notifications@github.com wrote:
|
I was about to try to isolate the error when I noticed that it's occurring for fields that have filters. Here's an example:
I guess filters are not supported in attributes? |
Oooh, no. Attributes are supposed to be the field name (e.g. username) or field path (e.g. user.firstName) within the form data object. What are you trying to accomplish with the above filter? Is it just a display thing (prefixing the input value with "$" but not writing that value to the form-data object?) |
Oops. Yes, it's just for formatting. It formats it OK, but I see now that On 5 August 2015 at 11:30, Brian Vaughn notifications@github.com wrote:
Regards |
Hm, short answer is that there's no way to do this in formFor currently. Custom labels are easy but masking an input value is a request I haven't received before. I'm open to the idea but I don't really have much spare time to build it myself. Any chance you may be interested in contributing some code? I'd be happy to review it :) |
I apologize for my noobishness, but could you please explain the phrases On 6 August 2015 at 12:42, Brian Vaughn notifications@github.com wrote:
Regards |
No problem. It's not noobish. It's been a long day and my terminology is probably not good. formFor supports configurable labels, by which I mean...you can choose the text (if any) that appears bolded before the input field. You can do this like so: <text-field label="My Custom Label"> Angular also has the concept of filters that format values coming from the model before they're displayed in the view. This is what you were trying to use. Unfortunately formFor doesn't support theres- or rather, it doesn't unless you create your own custom input type. There's no way to hook into a formFor field's incoming value (from the model) to format it (before it's shown in the view). |
I just looked into it a bit more and saw that it's not even inherently
supported by Angular. There's so much magic in Angular that I'd just
assumed/hoped that defining a filter in an ng-model (or form-for attribute)
field would link up both a formatter and a parser. It appears that a
filter is only for formatting, which is perfectly understandable.
Actually, it's really not necessary for my input fields to be formatted as
currency, so I'll just present them as plain numbers. It's a very minor
detail in the overall scheme of things, so it would be silly of me to
pursue it.
Thanks for your time once again.
|
Not a problem! Thanks for being so easy to chat with. :) Going to close this issue for now then. If you change your mind about its importance- let's reopen it and talk more. |
I'm seeing the error-message,
TypeError: this.$parse_(...).assign is not a function
. It's coming from form-for.js. Here's the full stack-trace:I'm guessing I've got the wrong version of one of the includes or something, but I haven't managed to track it down yet. Do you have any ideas?
Thanks
Hans
The text was updated successfully, but these errors were encountered: