Skip to content

Mulit-line expressions are not working #6044

Closed

Description

@doliver3

Mulit-line expressions are not working.

If I put this in the template:

Ok: {{ "Hello " + "World on one line" }}

Not Ok: {{ "Hello " +
"World split" }}

I get this output where the expression was not parsed for the expression split on multiple lines:

Ok: Hello World on one line
Not Ok: {{ "Hello " + "World split" }}

I'm using the latest beta version: 2.0.0-beta.0"

Activity

  1. wesleycho commented on Dec 21, 2015

    @wesleycho
    Contributor

    To describe this in depth since there is not enough detail here, Angular 2 does not throw an error, but instead just handles it this way

    Input

    {{'foo' +
        'bar'}}

    Output

    {{'foo' + 'bar'}}

    It strips out the new line character, but does not actually interpolate.

  2. 0x-r4bbit commented on Dec 21, 2015

    @0x-r4bbit
    Contributor

    Is this really a bug? Could we do multiline expressions in ng1?

  3. wesleycho commented on Dec 21, 2015

    @wesleycho
    Contributor

    @PascalPrecht just opened a PR fixing this - turns out the fix is super simple, and probably should be supported (although one should probably avoid doing complex expressions in the template itself for maintenance/testability reasons).

  4. michalstepien commented on Apr 18, 2016

    @michalstepien
  5. wesleycho commented on Apr 18, 2016

    @wesleycho
    Contributor

    Yep, this can be closed, the fix got merged in a few months ago

  6. pkozlowski-opensource commented on Apr 18, 2016

    @pkozlowski-opensource
    Member

    Thnx @michalstepien and @wesleycho ! Closing.

  7. angular-automatic-lock-bot commented on Sep 8, 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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions