String couldn't be converted to number by prefix + in the interpolation expression
See original GitHub issueI’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:
- Created 6 years ago
- Reactions:3
- Comments:5 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
PR raised since no reply from OP, suggested tags:
type: bug/fix
,comp: core & compiler
,effort1: easy (hours)
,freq1: low
,severity2: inconvenient
,workaround1: obvious
.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.