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

Handle any form of denormalized directives #17

Open
stramel opened this issue Oct 22, 2015 · 8 comments
Open

Handle any form of denormalized directives #17

stramel opened this issue Oct 22, 2015 · 8 comments

Comments

@stramel
Copy link
Contributor

stramel commented Oct 22, 2015

According to the official documentation, Angular allows the following:

<span ng-bind="name"></span>
<span ng:bind="name"></span>
<span ng_bind="name"></span>
<span data-ng-bind="name"></span>
<span x-ng-bind="name"></span> 

Currently, only ng- and data-ng- are supported. (https://github.com/ramonvictor/gulp-protractor-qa/blob/master/lib/find-view-matches.js#L55)

Reference: https://docs.angularjs.org/guide/directive#normalization

@ramonvictor
Copy link
Owner

I'm working on it now! Thanks for your contributions, @stramel! Very welcome! :)

@ramonvictor
Copy link
Owner

Just an update on this, selectors with : don't seem to be supported by cheerio. I get this error:

SyntaxError: Malformed attribute selector: ng:repeat="

When I remove ng: option all works fine. Thus, I'm not including ng: variation for now.

@stramel
Copy link
Contributor Author

stramel commented Oct 22, 2015

I'm wondering if there would be a way to wildcard match the attribute and strip off the ng:, ng-, ng_ and everything before the ng. That would cover all cases but I'm not sure if it would be possible to look for an attribute containing bind

@ramonvictor
Copy link
Owner

694c2f7 should cover all prefixes, except ng:.

@ramonvictor
Copy link
Owner

I know what you mean, I'll think about it later. I want to focus on publishing this refactored version first.

@stramel
Copy link
Contributor Author

stramel commented Oct 22, 2015

I agree, it would be good to get this out.

@stramel
Copy link
Contributor Author

stramel commented Oct 22, 2015

@ramonvictor Thoughts?

Using the Cheerio Plugins to create a different find method that strips the prefixes.

@ramonvictor
Copy link
Owner

@stramel that sounds a good approach. I'll take a look on it soon. Thanks for one more nice suggestion.

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