-
+
+
diff --git a/src/app/modules/admin/board/notice/components/list.component.ts b/src/app/modules/admin/board/notice/components/list.component.ts
index 7aec46c..e52609c 100644
--- a/src/app/modules/admin/board/notice/components/list.component.ts
+++ b/src/app/modules/admin/board/notice/components/list.component.ts
@@ -5,7 +5,9 @@ import {
Component,
OnDestroy,
OnInit,
+ QueryList,
ViewChild,
+ ViewChildren,
ViewEncapsulation,
} from '@angular/core';
import {
@@ -14,7 +16,7 @@ import {
FormGroup,
Validators,
} from '@angular/forms';
-import { MatCheckboxChange } from '@angular/material/checkbox';
+import { MatCheckbox, MatCheckboxChange } from '@angular/material/checkbox';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import {
@@ -66,7 +68,10 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChild(MatPaginator) private _paginator!: MatPaginator;
@ViewChild(MatSort) private _sort!: MatSort;
+ @ViewChildren('chkNotices') chkNotices!: QueryList;
+
notices$!: Observable;
+ __checkedNotices: string[] = [];
isLoading = false;
searchInputControl = new FormControl();
@@ -197,4 +202,24 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
__trackByFn(index: number, item: any): any {
return item.id || index;
}
+
+ __onChangeChkNoticesAll(event: MatCheckboxChange): void {
+ let checked = event.checked;
+ this.chkNotices.forEach((c, i) => {
+ c.checked = checked;
+ });
+ this.__updateCheckedNotices();
+ }
+ __onChangeChkNotices(event: MatCheckboxChange): void {
+ this.__updateCheckedNotices();
+ }
+
+ __updateCheckedNotices(): void {
+ this.__checkedNotices = [];
+ this.chkNotices.forEach((c, i) => {
+ if (c.checked) {
+ this.__checkedNotices.push(c.value);
+ }
+ });
+ }
}