datasurvey/src/main/webapp/app/layouts/profiles/page-ribbon.component.ts

25 lines
743 B
TypeScript
Raw Normal View History

2021-07-03 21:48:27 +00:00
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { ProfileService } from './profile.service';
@Component({
selector: 'jhi-page-ribbon',
template: `
<div class="ribbon" *ngIf="ribbonEnv$ | async as ribbonEnv">
<a href="" jhiTranslate="global.ribbon.{{ ribbonEnv }}">{{ ribbonEnv }}</a>
</div>
`,
styleUrls: ['./page-ribbon.component.scss'],
})
export class PageRibbonComponent implements OnInit {
ribbonEnv$?: Observable<string | undefined>;
constructor(private profileService: ProfileService) {}
ngOnInit(): void {
this.ribbonEnv$ = this.profileService.getProfileInfo().pipe(map(profileInfo => profileInfo.ribbonEnv));
}
}