-
Notifications
You must be signed in to change notification settings - Fork 58
Not able to validate forms with isolate scope inputs #37
Comments
I checked out the more examples with dynamic inputs. Here is more info on my situation. The form correctly reports its valid state, like this:
And when I correctly enter data, the output changes to read true. This is because in the check on this line In fact, If I inspect scope I see that $validationSummary is nested within:
And If I use |
In reality I did not play much with dynamic inputs, and every time I did, I already had a Form. Without a valid Form, I simply cannot run the If you have multiple forms on the page, the |
I'm actually facing this problem right now when using it inside a modal window (with Angular-UI Modal), it doesn't seem to be using the same scope because of an isolate scope. So I'm looking into having the possibility to pass your own scope to the Angular-Validation, something like this: $scope.$validationOptions = { scope: yourScope }; I'm on the proof of concept with this in my modal window, but it seems to work so far... any comments? |
- Added possibility to use own isolated scope (issue #37 and #26). - Fixed an implementation issue found from last revision (issue #35). - Fixed email validation (issue #38). - Fixed a performance issue found with onBlur which would run as much validations as there was characters inside the input when onBlur was called (abcdef => would make 6 validations) and this was extremely costly with a Remote validation call. - Update the code of Remote validation to also accept the "As" alias "remote:vm.customRemoteValidation". - Finally added and updated a few Protractor tests to cover all of the above and more.
This should be fixed now, I had this issue with a Modal window and now this new fix works perfectly with version 1.3.27. See the Wiki - Isolated Scope Let me know if there is anything wrong with it. |
I have a directive that creates inputs. Something like:
I use this in my form to generate inputs, like so:
This causes errors when I try to validate in my controller, like so:
If I include the inputs in my form without using the custom directive, the form validates properly.
I get why this happens... but is there a workaround for this? Or another best practice for this case?
The text was updated successfully, but these errors were encountered: