Comments (9)
Sorry to hear that you're seeing an error. Can you provide a Plunker so I
can take a look?
$parse is a built-in Angular service so I'm not sure that a dependency is
to blame. Which versions of form for and Angular are you using?
On Monday, August 3, 2015, EnterpriseDT [email protected] wrote:
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:TypeError: this.$parse_(...).assign is not a function
at NestedObjectHelper.writeAttribute (http://localhost/portal/lib/angular/js/form-for.js:843:37)
at FormForStateHelper.setFieldHasBeenModified (http://localhost/portal/lib/angular/js/form-for.js:2718:38)
at target.validateField (http://localhost/portal/lib/angular/js/form-for.js:1169:39)
at Object. (http://localhost/portal/lib/angular/js/form-for.js:1072:28)
at Object.scopePrototype.$watch.arguments.(anonymous function) as fn
at h.$get.h.$digest (http://localhost/portal/lib/angular/js/angular.min.js:110:373)
at h.scopePrototype.$digest (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1924:23)
at h.$get.h.$apply (http://localhost/portal/lib/angular/js/angular.min.js:113:362)
at h.scopePrototype.$apply (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1987:22)
at m (http://localhost/portal/lib/angular/js/angular.min.js:72:454)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—
Reply to this email directly or view it on GitHub
#151.
from angular-form-for.
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:
<text-field label="Discount" attribute="payment.discount | currency:'$'" disable="true"></text-field>
I guess filters are not supported in attributes?
from angular-form-for.
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?)
from angular-form-for.
Oops. Yes, it's just for formatting. It formats it OK, but I see now that
parsing doesn't work, which is understandable. How should I be doing this?
On 5 August 2015 at 11:30, Brian Vaughn [email protected] wrote:
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?)—
Reply to this email directly or view it on GitHub
#151 (comment)
.
Regards
Hans Andersen
EnterpriseDT
from angular-form-for.
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 :)
from angular-form-for.
I apologize for my noobishness, but could you please explain the phrases
'custom labels' and 'masking an input value'. Neither or these mean
anything specific to me in the context of Angular.
On 6 August 2015 at 12:42, Brian Vaughn [email protected] wrote:
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 :)—
Reply to this email directly or view it on GitHub
#151 (comment)
.
Regards
Hans Andersen
EnterpriseDT
from angular-form-for.
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).
from angular-form-for.
from angular-form-for.
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.
from angular-form-for.
Related Issues (20)
- Can i validate HTML or other controls using Form-for HOT 21
- Form is submitted when required checkboxes are not checked HOT 8
- Feature request: never validate not-required blank/empty/unchecked inputs HOT 4
- No option to add multiple custom rules to the same field HOT 4
- Checkbox Fix Release HOT 1
- Problem with latest release HOT 9
- Formatting - Select-field HOT 2
- Enable number fields HOT 6
- checkboxField change event does not fire HOT 1
- increment validation HOT 4
- Minimum/maximum rule doesn't work when number is zero HOT 9
- SelectField auto selects the last option initially HOT 6
- Plans for Angular 2? HOT 2
- Support for asynchronous schemas HOT 2
- JSON Schema support HOT 1
- Add support for latest angular-material version HOT 3
- TypeError: Cannot read property 'unwatchers' of undefined HOT 4
- The homepage is dead HOT 1
- Dynamically change validationRules depending on submit action
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-form-for.