Skip to content

Commit

Permalink
refactor(material/list): use classList.toggle
Browse files Browse the repository at this point in the history
With Angular dropping IE11 support in version 13, we can now use `classList.toggle` with the second `force` param. Related to angular#7374
  • Loading branch information
jelbourn committed Sep 13, 2021
1 parent d8acc1f commit a8ceddb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/material/core/line/line.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ export function setLines(lines: QueryList<unknown>, element: ElementRef<HTMLElem

/** Adds or removes a class from an element. */
function setClass(element: ElementRef<HTMLElement>, className: string, isAdd: boolean): void {
const classList = element.nativeElement.classList;
isAdd ? classList.add(className) : classList.remove(className);
element.nativeElement.classList.toggle(className, isAdd);
}

@NgModule({
Expand Down

0 comments on commit a8ceddb

Please sign in to comment.