Title: Support providing a space-separated list of classes when using [class] bindings · Issue #62469 · angular/angular · GitHub
Open Graph Title: Support providing a space-separated list of classes when using [class] bindings · Issue #62469 · angular/angular
X Title: Support providing a space-separated list of classes when using [class] bindings · Issue #62469 · angular/angular
Description: Which @angular/* package(s) are relevant/related to the feature request? core Description While migrating my app to Angular 20 and changing to the new control flow syntax, I thought I would also remove [ngClass] in favour of [class] The ...
Open Graph Description: Which @angular/* package(s) are relevant/related to the feature request? core Description While migrating my app to Angular 20 and changing to the new control flow syntax, I thought I would also re...
X Description: Which @angular/* package(s) are relevant/related to the feature request? core Description While migrating my app to Angular 20 and changing to the new control flow syntax, I thought I would also re...
Opengraph URL: https://github.com/angular/angular/issues/62469
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support providing a space-separated list of classes when using [class] bindings","articleBody":"### Which @angular/* package(s) are relevant/related to the feature request?\n\ncore\n\n### Description\n\nWhile migrating my app to Angular 20 and changing to the new control flow syntax, I thought I would also remove [ngClass] in favour of [class]\n\nThe problem is that [class] does not support the way you usually add tailwind.\n\n```html\n\u003cdiv [class]=\"[\n 'flex flex-col',\n showActive && 'bg-green-700',\n]\">\u003c/div>\n\n\u003cdiv [class]=\"{\n 'flex flex-col': true,\n 'bg-green-700 text-white: showActive,\n}\">\u003c/div>\n```\n\n\n\nI think a lot of people (including myself) thought this would just work, and the path angular has been taking with removing the control flow directives, that you should prefer using [class] over [ngClass]\n\n\nI found this issue where it was said that it would not get fixed, which I can understand.\nhttps://github.com/angular/angular/issues/54605\n\nBut maybe there should be a disclaimer on [class] saying that the above does not work and you should use ngClass\n\n### Proposed solution\n\nif angular is heading in the direction that [class] is going to be the preferred way of adding classes, we should reconsider adding the string splitting to [class] because of tailwinds success (and clsx)\n\nif not\n\nadd a big note in the [class] documentation saying you need to use [ngClass] instead when writing the above.\n\n### Alternatives considered\n\njust use ngClass","author":{"url":"https://github.com/leon","@type":"Person","name":"leon"},"datePublished":"2025-07-04T10:05:12Z","url":"https://github.com/angular/angular/issues/62469"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:868b6160-7236-6966-c46f-c623b973497c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EC5C:DA744:15E4E1D:1D6DA0B:6B01420A |
| html-safe-nonce | 9b6c6d2af8206d0b5408d9e9a6924f3ca396b3058300927cfdf311a51e376718 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzVDOkRBNzQ0OjE1RTRFMUQ6MUQ2REEwQjo2QjAxNDIwQSIsInZpc2l0b3JfaWQiOiI5NjAzODAxNTgzMzY5MDk4MzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9e0ffa26a5cd5af7ee020d1367cbb90c647153b0f48c7c2483f4b9bd9183dd5e |
| hovercard-subject-tag | issue:3202082871 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/62469/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7982f068e5615aa73715e7edc8ad823cb51e37783ef78e489d5a185227fc3a0a/angular/angular/issues/62469 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7982f068e5615aa73715e7edc8ad823cb51e37783ef78e489d5a185227fc3a0a/angular/angular/issues/62469 |
| og:image:alt | Which @angular/* package(s) are relevant/related to the feature request? core Description While migrating my app to Angular 20 and changing to the new control flow syntax, I thought I would also re... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | leon |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width