src/lib/footer/footer.component.ts
| changeDetection | ChangeDetectionStrategy.OnPush |
| selector | rxap-footer |
| imports |
MatToolbarModule
PortalModule
|
| styleUrls | ./footer.component.scss |
| templateUrl | ./footer.component.html |
Properties |
|
| Protected Readonly footerService |
Default value : inject(FooterService)
|
|
Defined in src/lib/footer/footer.component.ts:20
|
| Public Readonly hasPortals |
Default value : computed(() => this.portals().length > 0)
|
|
Defined in src/lib/footer/footer.component.ts:23
|
| Public Readonly portals |
Default value : computed(() => this.footerService.portals())
|
|
Defined in src/lib/footer/footer.component.ts:22
|
import { PortalModule } from '@angular/cdk/portal';
import {
ChangeDetectionStrategy,
Component,
computed,
inject,
} from '@angular/core';
import { MatToolbarModule } from '@angular/material/toolbar';
import { FooterService } from '../footer.service';
@Component({
selector: 'rxap-footer',
templateUrl: './footer.component.html',
styleUrls: ['./footer.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [MatToolbarModule, PortalModule]
})
export class FooterComponent {
protected readonly footerService = inject(FooterService);
public readonly portals = computed(() => this.footerService.portals());
public readonly hasPortals = computed(() => this.portals().length > 0);
}
@if (hasPortals()) {
<mat-toolbar class="mat-elevation-z1">
@for (portal of portals(); track portal) {
<mat-toolbar-row>
<ng-template [cdkPortalOutlet]="portal"></ng-template>
</mat-toolbar-row>
}
</mat-toolbar>
}
./footer.component.scss