File

apps/demo/src/app/pages/entities-page/groups-frame/groups-frame.component.ts

Metadata

changeDetection ChangeDetectionStrategy.OnPush
selector groups-frame
templateUrl ./groups-frame.component.html

Index

Properties

Constructor

constructor(_activatedRoute: ActivatedRoute)
Parameters :
Name Type Optional
_activatedRoute ActivatedRoute No

Properties

Public apiUrl
Default value : environment.apiUrl
parentTitle$
Type : Observable<string>
title$
Type : Observable<string>
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { BindIoInner } from 'ngx-bind-io';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { environment } from '../../../../environments/environment';

@BindIoInner()
@Component({
  selector: 'groups-frame',
  templateUrl: './groups-frame.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class GroupsFrameComponent {
  public apiUrl = environment.apiUrl;
  parentTitle$: Observable<string>;
  title$: Observable<string>;
  constructor(private _activatedRoute: ActivatedRoute) {
    this.parentTitle$ = this._activatedRoute.parent.parent.data.pipe(map(data => data && data.meta && data.meta.title));
    this.title$ = this._activatedRoute.data.pipe(map(data => data && data.meta && data.meta.title));
  }
}
<div class="container-fluid">
    <h3 class="page-header">
        <span class="ident">{{ parentTitle$ | async | translate}}:</span>
        <span>{{ title$ | async | translate}}</span>
    </h3>
    <groups-grid [apiUrl]="apiUrl"></groups-grid>
</div>
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""