File

src/lib/footer/footer.component.ts

Metadata

Index

Properties

Properties

Protected Readonly footerService
Default value : inject(FooterService)
Public Readonly hasPortals
Default value : computed(() => this.portals().length > 0)
Public Readonly portals
Default value : computed(() => this.footerService.portals())
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

Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""