File

src/app/components/version-label/version-label.component.ts

Implements

OnInit

Metadata

Index

Properties
Methods

Constructor

constructor(sessionStore: SessionStore)
Parameters :
Name Type Optional
sessionStore SessionStore No

Methods

ngOnInit
ngOnInit()
Returns : void

Properties

version
Type : string
import { Component, OnInit } from '@angular/core';
import { filter, map } from 'rxjs/operators';
import { SessionStore } from '../../providers';

@Component({
  selector: 'app-version-label',
  templateUrl: './version-label.component.html',
  styleUrls: ['./version-label.component.css']
})
export class VersionLabelComponent implements OnInit {
  version: string;
  constructor(private sessionStore: SessionStore) {}

  ngOnInit() {
    this.sessionStore.session$
      .pipe(
        filter(
          session =>
            session !== null &&
            session !== undefined &&
            session.version !== null &&
            session.version !== undefined &&
            session.version.length > 0
        ),
        map(session => session.version)
      )
      .subscribe(version => {
        this.version = `v${version}`;
      });
  }
}
<label *ngIf="version" [title]="version" class="no-print">
  <small class="version no-print">
    {{version}}
  </small>
</label>

./version-label.component.css

.version {
  position: fixed;
  bottom: 0;
  right: 0;
  padding: 0.25rem 1rem 0.1rem 1rem;
  color: #999;
}

/* .version {
  position: fixed;
  text-align: right;
  padding: 5px;
  color: #999;
  width: calc(100% - 10px);
  background-color: #fff;
} */
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""