Skip to content
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

unique field event #22

Closed
gilad1987 opened this issue Jun 13, 2014 · 8 comments
Closed

unique field event #22

gilad1987 opened this issue Jun 13, 2014 · 8 comments

Comments

@gilad1987
Copy link

There is a problem if I have some fields with the same name in various forms page
So he checks them all even though it is different form,
I just added a random number and that's how I created a unique field

@hueitan
Copy link
Owner

hueitan commented Jun 13, 2014

Opps

Thanks @gilad1987 I got your point.

Here's the error cause
https://github.com/huei90/angular-validation/blob/master/src/directive.js#L173

The scope.$on('something') doesn't unqiue that's why cause your problem

How do you add the random number ? Could you give me a PR ?

@hueitan hueitan added the bug label Jun 13, 2014
@gilad1987
Copy link
Author

sorry, what is PR ?

@gilad1987
Copy link
Author

just add:
in line 194: $scope.$broadcast(k + 'submit' + form[k].index, idx++);
in line 437:
ctrl.index = Math.random();
scope.$on(ctrl.$name + 'submit' + ctrl.index, function (event, index)

@hueitan
Copy link
Owner

hueitan commented Jun 13, 2014

Then how do you fix by adding a random number ?

PR is pull request

@hueitan
Copy link
Owner

hueitan commented Jun 13, 2014

🍻 @gilad1987

That's cool.

You try to google what's PR, and if you don't mind give me a PR to angular-validation repo.

Otherwise i will do it by myself.

Thanks !

@hueitan hueitan added this to the 1.2.0 milestone Jun 13, 2014
@gilad1987
Copy link
Author

At the moment I can not, I'll try later

Thank you, great module

@hueitan
Copy link
Owner

hueitan commented Jun 13, 2014

Sure 👍

hueitan added a commit that referenced this issue Jun 15, 2014
@hueitan
Copy link
Owner

hueitan commented Jun 15, 2014

@gilad1987 I have updated.

Thanks for this issue 🍻

@hueitan hueitan closed this as completed Jun 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants