Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 18 2017 18:54
    lizdenhup opened #189
  • Apr 12 2016 16:20

    indrimuska on 4.1.12

    (compare)

  • Apr 12 2016 16:18

    indrimuska on master

    Form data and field name passed… (compare)

  • Apr 01 2016 08:29
    indrimuska commented #188
  • Apr 01 2016 08:29
    indrimuska closed #188
  • Apr 01 2016 07:00
    train255 opened #188
  • Mar 08 2016 06:48
    bvaughn commented #186
  • Mar 08 2016 06:39
    baconcutter commented #186
  • Mar 08 2016 02:11
    bvaughn commented #186
  • Mar 08 2016 02:11
    bvaughn closed #186
  • Mar 08 2016 02:09

    bvaughn on 4.1.11

    (compare)

  • Mar 08 2016 02:09

    bvaughn on master

    Built 4.1.11 release (compare)

  • Mar 08 2016 02:02

    bvaughn on master

    Fix bug #186 "TypeError: Cannot… Merge pull request #187 from ba… (compare)

  • Mar 08 2016 02:02
    bvaughn closed #187
  • Mar 08 2016 02:01
    bvaughn commented #187
  • Mar 07 2016 19:35
    baconcutter opened #187
  • Mar 02 2016 15:35
    bvaughn labeled #186
  • Mar 02 2016 15:35
    bvaughn commented #186
  • Mar 02 2016 07:34
    baconcutter opened #186
  • Feb 11 2016 04:12

    bvaughn on master

    Added end-of-life announcement … (compare)

Stanislav Pereverziev
@spereverziev
Hi, I would like to make code contribution
Brian Vaughn
@bvaughn
Hi there. :) I'd welcome the contribution.
What did you have in mind?
Kamilla Khabibrakhmanova
@KamillaKhabibrakhmanova
Hi! I'm really appreciating this library, thank you for working on it! I just had a question about using nested form/collections: the samples I have so far require setting the key separately, but I wanted to have each item in a collection have to input fields for one key/value pair: one that sets the key of the item and one that sets the value. So it could have like two inputs: title and message, and then get stored as [{title:message}], instead of [{title:title, message:message}] as I've seen it being used so far. Is this possible in the current version?
Brian Vaughn
@bvaughn
Oh my. I'm very sorry for ignoring this message for so long!
@KamillaKhabibrakhmanova You are very welcome :) What you have described is not possible with formFor, but perhaps could be achieved in a round-about way by using a custom validator for both attributes? Since the validator would be called each time either attribute changed- it could write to the dynamic property.
Does this make sense?
Brian Vaughn
@bvaughn
@KamillaKhabibrakhmanova Here is a plunker demonstrating the approach I am talking about http://plnkr.co/edit/tB1eGu8r4GiDmxvGRQ6n?p=preview
Andrius
@andrius-kulbis
Hello, how can I validate if two fields match? Like email or password?
Andrius
@andrius-kulbis
Ah sorry, found the answer in docs :)
Brian Vaughn
@bvaughn
@andrius-kulbis Glad you found the answer :)
Andrius
@andrius-kulbis
Hello again, is there a way to validate entire form server side, and then map the errors on corresponding fields?
Brian Vaughn
@bvaughn
Hi again.
Do you want to validate after submit? or after a field has chagned?
Brian Vaughn
@bvaughn
If on-submit it's easy. formFor will just parse an error object returned and show the failed fields.
If you want to validate on-change you could create a single validation function that gets shared for all fields. (or even just listen for field-changes manually) and when you get the server response, use the http://bvaughn.github.io/angular-form-for/#/documentation/FormForController updateFieldErrors method
Andrius
@andrius-kulbis
This message was deleted
Andrius
@andrius-kulbis

I get the following form validation structure from my backend:

{
    "code": 400,
    "message": "Validation Failed";
    "errors": {
        "children": {
            "code": {
                "errors": [
                    "This value should not be blank."
                ]
            },
            "name": {
                "errors": [
                    "This value should not be blank."
                ]
            },
            "description": {
                "errors": [
                    "This value should not be blank."
                ]
            }
        }
    }
}

The children object keys represent form fields and their validation errors. What would be the proper way of mapping these errors to formFor? I want to do the validation on form submit.

Andrius
@andrius-kulbis

Well, got this one working to, again thanks to good documentation (y)

this.onSubmitError = function (response) {
    var errorMap = ErrorParser.parse(response);
    self.formController.updateFieldErrors(errorMap);
 }

How can I apply this to all forms? There is FormForConfiguration.setDefaultSubmitError(callback) but I don't have a formController there to set the map

Brian Vaughn
@bvaughn
:D Glad to hear you were able to find a solution.
Hmm.
Seems like a good feature request @andrius-kulbis :) Off the top, I suspect we could pass a reference to the current form controller through to the default/global error handler.
Would you file a ticket for it? I'm super swamped at the moment so it may take me a while to get to it. I'd be happy to accept a pull request if you beat me to it though :D
Brian Vaughn
@bvaughn
Thanks @andrius-kulbis :) 4.1.6 just went out with your change.
Punita Ojha
@punitaojha
This message was deleted