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

use of angular brackets in attribute causes template to error out #52

Open
xpressivecode opened this issue Dec 10, 2016 · 0 comments
Open

Comments

@xpressivecode
Copy link

works

{{foo}}

fails

[data-colour="{{foo}}"]

It looks like you have a fix in place for the text parser that converts {{foo}} to {{"{{"}}foo{{"}}"}}. However, if you attempt to use angular brackets on a tags attribute, it will cause the template package to throw an error.

When the tag parser loops through the attributes, would it be possible to have it call the same regex replace as the text parser?

Or do you have another work around?

I did try moving the regex replace into it's own function and then having the visitText use it, as well as the attribute loop right at the end to replace the value. It fixed my particular issue, but does cause 1 test to fail. Test_FuncCall.

I tried just using the compiler to output a string via CompileString() and then using a new template, changing the delimiter, but then because of the visitText regex, it's producing invalid angularjs as the template ignores the {{"{{"}} etc. as the delimiter has changed. So while that fixes the attribute issue, it introduces an issue with the text parser.

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

1 participant