Skip to content

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

Closed

Description

@Foxandxss

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.

Activity

  1. added this to the beta.0 milestone on Dec 3, 2015
  2. pkozlowski-opensource commented on Dec 3, 2015

    @pkozlowski-opensource
    Member

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

  3. vicb commented on Dec 3, 2015

    @vicb
    Contributor

    @yjbanov could you take a look ?

  4. self-assigned this
    on Dec 3, 2015
  5. yjbanov commented on Dec 3, 2015

    @yjbanov
    Contributor

    Yep, I'll take a look.

  6. yjbanov commented on Dec 6, 2015

    @yjbanov
    Contributor

    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.

  7. assigned and unassigned on Dec 6, 2015
  8. vicb commented on Dec 6, 2015

    @vicb
    Contributor

    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
    
  9. changed the title [-]Ternary operator inside interpolation is raising an error[/-] [+]HTML Parser: "<" is not allowed in a text node[/+] on Dec 6, 2015
  10. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    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.

  11. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions