Skip to content

Commit dee37f0

Browse files
committed
Migration from NgClass to class bindings #11932
1 parent f0a9f49 commit dee37f0

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

projects/natural/src/lib/modules/search/search/search.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="natural-search" [ngClass]="{mobile: isMobile | async, hasMultipleGroups: innerSelections().length > 1}">
1+
<div class="natural-search" [class.mobile]="isMobile | async" [class.hasMultipleGroups]="innerSelections().length > 1">
22
<div class="groupsWrapper">
33
@for (groupSelections of innerSelections(); track $index) {
44
<div class="groupWrapper">

projects/natural/src/lib/modules/search/search/search.component.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,11 @@ import {MatIcon} from '@angular/material/icon';
1010
import {MatTooltip} from '@angular/material/tooltip';
1111
import {MatIconButton} from '@angular/material/button';
1212
import {NaturalGroupComponent} from '../group/group.component';
13-
import {AsyncPipe, NgClass} from '@angular/common';
13+
import {AsyncPipe} from '@angular/common';
1414

1515
@Component({
1616
selector: 'natural-search',
17-
imports: [
18-
NgClass,
19-
AsyncPipe,
20-
NaturalGroupComponent,
21-
MatIconButton,
22-
MatTooltip,
23-
MatIcon,
24-
NaturalIconDirective,
25-
MatDivider,
26-
],
17+
imports: [AsyncPipe, NaturalGroupComponent, MatIconButton, MatTooltip, MatIcon, NaturalIconDirective, MatDivider],
2718
templateUrl: './search.component.html',
2819
styleUrl: './search.component.scss',
2920
})

src/app/home/home.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<mat-toolbar [class]="`nat-horizontal nat-left nat-center nat-gap`">
1+
<mat-toolbar class="nat-horizontal nat-left nat-center nat-gap">
22
@if (menu) {
33
<button mat-icon-button (click)="menu.toggle()">
44
<mat-icon naturalIcon="menu" />

0 commit comments

Comments
 (0)