Giter VIP home page Giter VIP logo

Comments (9)

bvaughn avatar bvaughn commented on May 18, 2024

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.

 avatar commented on May 18, 2024

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.

bvaughn avatar bvaughn commented on May 18, 2024

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.

 avatar commented on May 18, 2024

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.

bvaughn avatar bvaughn commented on May 18, 2024

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.

 avatar commented on May 18, 2024

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.

bvaughn avatar bvaughn commented on May 18, 2024

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.

 avatar commented on May 18, 2024

from angular-form-for.

bvaughn avatar bvaughn commented on May 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.