File
Implements
Constructor
constructor(windowService: WindowService, cdr: ChangeDetectorRef)
|
|
|
Parameters :
| Name |
Type |
Optional |
| windowService |
WindowService
|
No
|
| cdr |
ChangeDetectorRef
|
No
|
|
|
Public
cdr
|
Type : ChangeDetectorRef
|
Decorators :
@Inject(ChangeDetectorRef)
|
|
|
|
Public
subscriptions
|
Default value : new Subscription()
|
|
|
|
Public
windowService
|
Type : WindowService
|
Decorators :
@Inject(WindowService)
|
|
|
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
Inject,
OnDestroy,
OnInit,
} from '@angular/core';
import { WindowService } from '../window.service';
import { Subscription } from 'rxjs';
import { tap } from 'rxjs/operators';
import { WindowTaskComponent } from './window-task/window-task.component';
import { NgFor } from '@angular/common';
@Component({
selector: 'rxap-window-task-bar',
templateUrl: './window-task-bar.component.html',
styleUrls: ['./window-task-bar.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [NgFor, WindowTaskComponent]
})
export class WindowTaskBarComponent implements OnInit, OnDestroy {
public subscriptions = new Subscription();
constructor(
@Inject(WindowService) public windowService: WindowService,
@Inject(ChangeDetectorRef) public cdr: ChangeDetectorRef,
) {
}
public ngOnInit(): void {
this.subscriptions.add(this.windowService.activeCount$.pipe(
tap(() => this.cdr.markForCheck()),
).subscribe());
}
public ngOnDestroy(): void {
this.subscriptions.unsubscribe();
}
}
<div class="tasks grow-0 flex flex-row flex-wrap">
<rxap-window-task *ngFor="let window of windowService.allActiveWindows"
[window]="window"
class="grow-0">
</rxap-window-task>
</div>
Legend
Html element with directive