[class]="classExpression" is not working in Angular 12.2.16
See original GitHub issueWhich @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
<p [class]="{'blue-color': isBlue, 'red-background': isRed}">Test</p>
<p [class]="['red-background', 'blue-color']">Test</p>
both the types not working as expected.
Please provide a link to a minimal reproduction of the bug
https://codesandbox.io/s/morning-hill-t6tevq?file=/src/app/app.component.html
Please provide the exception or error you saw
Both styles mentioned in expression should be applied.
Please provide the environment you discovered this bug in (run ng version
)
Angular version: 12.2.16
Anything else?
No response
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
npm install fails with NPM 7 #19957 - angular/angular-cli
I've encountered similar issues (NPM 7.5.2), but when creating new project ( ng new ng-app ), I get: npm ERR! ERESOLVE unable to ......
Read more >Meaning of error in Angular: "application depends upon a ...
In my case Angular CLI was 14.1.1 and Angular was 12.2.16 which was the problem. If they are not of same version, you...
Read more >Angular versioning and releases
We update peer dependencies in minor versions by expanding the supported versions, but we do not require projects to update these dependencies. Patch...
Read more >Angular CLI - npm
Angular CLI - The CLI tool for Angular. The sources for this package are in the Angular CLI repository. Please file issues and...
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 FreeTop 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
Top GitHub Comments
Looks like bug in codesandbox. Can you share minimal reproduction via github.
I just tested in stackblitz and it is working as expected.
https://stackblitz.com/edit/angular-ivy-cf2srw?file=src%2Fapp%2Fapp.component.ts,src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.component.css
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.