mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
docs: explicit that class bindings still support object (#62102)
PR Close #62102
This commit is contained in:
parent
3f3c98627c
commit
cd4ac81fc6
1 changed files with 3 additions and 0 deletions
|
|
@ -222,6 +222,9 @@ Prefer `class` and `style` bindings over using the `NgClass` and `NgStyle` direc
|
|||
```html
|
||||
<!-- PREFER -->
|
||||
<div [class.admin]="isAdmin" [class.dense]="density === 'high'">
|
||||
<!-- OR -->
|
||||
<div [class]="{admin: isAdmin, dense: density === 'high'}">
|
||||
|
||||
|
||||
<!-- AVOID -->
|
||||
<div [ngClass]="{admin: isAdmin, dense: density === 'high'}">
|
||||
|
|
|
|||
Loading…
Reference in a new issue