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

HTML Parser: "<" is not allowed in a text node #5550

Closed
Foxandxss opened this issue Dec 2, 2015 · 6 comments
Closed

HTML Parser: "<" is not allowed in a text node #5550

Foxandxss opened this issue Dec 2, 2015 · 6 comments
Assignees
Milestone

Comments

@Foxandxss
Copy link
Member

So in the past I could do:

{{ a < b ? a : b }}

Not anymore, it raises an issue on the : which makes me think that is all about b6ec238.

We need that on ng-bootstrap (lot of conditionals we have in there).

Check this plunker. If you put it on .46 it works.

@pkozlowski-opensource
Copy link
Member

Yes, this looks like a pretty severe regression, IMO we need to fix this one before beta.

@vicb
Copy link
Contributor

vicb commented Dec 3, 2015

@yjbanov could you take a look ?

@yjbanov yjbanov self-assigned this Dec 3, 2015
@yjbanov
Copy link
Contributor

yjbanov commented Dec 3, 2015

Yep, I'll take a look.

@yjbanov
Copy link
Contributor

yjbanov commented Dec 6, 2015

Confirmed that this is not a bug in quoted expressions. This seems to be a bug in the new HTML parser. It seems to choke on the < operator (likely expecting a tag there). Here's a plunker showing that if you move < into a getter the conditional expression still works.

@vicb
Copy link
Contributor

vicb commented Dec 6, 2015

Yep definitely a Parser issue - the error msg is clear about that:

ORIGINAL EXCEPTION: Template parse errors:
Unexpected character "'" ("
    <div>{{val1 < val2 ? [ERROR ->]'Lower' : 'Greater'}}</div>
  "): MyApp@1:25

@vicb vicb changed the title Ternary operator inside interpolation is raising an error HTML Parser: "<" is not allowed in a text node Dec 6, 2015
vicb added a commit to vicb/angular that referenced this issue Dec 6, 2015
vicb added a commit to vicb/angular that referenced this issue Dec 6, 2015
vicb added a commit to vicb/angular that referenced this issue Dec 7, 2015
vicb added a commit to vicb/angular that referenced this issue Dec 8, 2015
vicb added a commit to vicb/angular that referenced this issue Dec 8, 2015
@vicb vicb closed this as completed in aecf681 Dec 8, 2015
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants