page-ribbon.component.ts 741B

1234567891011121314151617181920212223
  1. import { Component, OnInit } from '@angular/core';
  2. import { ProfileService } from './profile.service';
  3. import { ProfileInfo } from './profile-info.model';
  4. @Component({
  5. selector: 'jhi-page-ribbon',
  6. template: `<div class="ribbon" *ngIf="ribbonEnv"><a href="" jhiTranslate="global.ribbon.{{ribbonEnv}}">{{ribbonEnv}}</a></div>`,
  7. styleUrls: ['page-ribbon.scss']
  8. })
  9. export class PageRibbonComponent implements OnInit {
  10. profileInfo: ProfileInfo;
  11. ribbonEnv: string;
  12. constructor(private profileService: ProfileService) {}
  13. ngOnInit() {
  14. this.profileService.getProfileInfo().then(profileInfo => {
  15. this.profileInfo = profileInfo;
  16. this.ribbonEnv = profileInfo.ribbonEnv;
  17. });
  18. }
  19. }