question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

String couldn't be converted to number by prefix + in the interpolation expression

See original GitHub issue

I’m submitting a…


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

In template, {{ +‘1’ + 2 }} will get 12.

Expected behavior

+‘1’ + 2 should get 3 same as JavaScript expression.

Minimal reproduction of the problem with instructions

https://stackblitz.com/edit/angular-e3oqrr?file=app%2Fapp.component.html

What is the motivation / use case for changing the behavior?

Environment


Angular version: X.Y.Z


Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
trotylcommented, Feb 11, 2018

PR raised since no reply from OP, suggested tags: type: bug/fix, comp: core & compiler, effort1: easy (hours), freq1: low, severity2: inconvenient, workaround1: obvious.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 13, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Thymeleaf: Concatenation - Could not parse as expression
I'm having an issue when trying to concat multiple values in my template. According to Thymeleaf here I should simply be able to...
Read more >
Understanding Angular property binding and interpolation
Angular finds the variable matching the text in the component and replaces the text with the value assigned to the variable. Numbers, strings, ......
Read more >
Using New ABAP stuff – new options for Strings - SAP Blogs
Consider the example below: the WRITE….TO… calls the conversion exit KONPD that converts an internal project number to an external project id.
Read more >
Interpolated Strings (Visual Basic Reference) - Microsoft Learn
Used to construct strings. An interpolated string looks like a template string that contains interpolated expressions.
Read more >
Syntax - The Meson Build system
Booleans can be converted to a string or to a number: ... inside of format strings, meaning you cannot use arbitrary Meson expressions...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found