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

1.3-1.4版本的angularjs w5c-dynamic-element 指令异常 #60

Closed
jfzhao opened this issue May 17, 2016 · 8 comments
Closed

1.3-1.4版本的angularjs w5c-dynamic-element 指令异常 #60

jfzhao opened this issue May 17, 2016 · 8 comments

Comments

@jfzhao
Copy link

jfzhao commented May 17, 2016

该指令好像只能运行在1.2环境下。

@jfzhao
Copy link
Author

jfzhao commented May 17, 2016

兄弟,我发现不加name就正常了。
但是错误信息的匹配有问题,然后我扩展了以$符结尾做近似处理的代码解决了。

@why520crazy
Copy link
Owner

你使用的Angular js 是 1.3-1.4? w5cValidator 版本是多少

@jfzhao
Copy link
Author

jfzhao commented May 18, 2016

v2.4.14

@jfzhao
Copy link
Author

jfzhao commented May 18, 2016

另外我貌似错误的提交了代码到你的主库里了,你可以看看。

@jfzhao
Copy link
Author

jfzhao commented May 18, 2016

master...jfzhao:master

@why520crazy
Copy link
Owner

http://blog.ngnice.com/angular-w5c-validator/example/index.html 示例使用的是 1.4.8, 没有你说的问题,不知道你是怎么使用的?

@jfzhao
Copy link
Author

jfzhao commented May 19, 2016

我的说法有点问题,如下的使用场景下,在低版本的angularjs中可以正常使用,而在高版本的angularjs中需要去除name=“repeat”,并且错误信息无法正确的匹配。

<div class="form-group" ng-repeat="r in repeatTest">

            `<div class="col-sm-10">
                <input type="text" required="" ng-model="r" name="repeat" w5c-dynamic-name="'repeat'+$index" w5c-dynamic-element class="form-control"
                       placeholder="">
            </div>`

</div>

@why520crazy
Copy link
Owner

你升级到 2.4.15,name 命名的时候使用 name$数字$ ,匹配验证规则的时候会忽略 $数字$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants