src/app/components/version-label/version-label.component.ts
selector | app-version-label |
styleUrls | ./version-label.component.css |
templateUrl | ./version-label.component.html |
Properties |
Methods |
constructor(sessionStore: SessionStore)
|
||||||
Parameters :
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
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;
} */