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.

[class]="classExpression" is not working in Angular 12.2.16

See original GitHub issue

Which @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:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
indraraj26commented, Aug 9, 2022

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

0reactions
angular-automatic-lock-bot[bot]commented, Sep 9, 2022

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

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 >

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