Skip to content
Snippets Groups Projects
Commit 2aaa0cf7 authored by L. Henze's avatar L. Henze
Browse files

Comcol Handle component

parent 948fa5cf
No related branches found
No related tags found
No related merge requests found
<div *ngIf="content" class="content-with-optional-title mb-2">
<h2 class="d-inline-block h6" *ngIf="title">{{ title | translate }}</h2>
<div class="d-inline-block "><a href="{{content}}">{{content}}</a></div>
<div class="d-inline-block "><a href="{{getHandle(content)}}">{{getHandle(content)}}</a></div>
</div>
import { Observable, of as observableOf, combineLatest as observableCombineLatest } from 'rxjs';
import { Component, Input } from '@angular/core';
import { Component, Input, Inject, Injectable } from '@angular/core';
import { GlobalConfig } from '../../../config/global-config.interface';
import { Inject, Injectable } from '@angular/core';
import { GLOBAL_CONFIG } from '../../../config';
import { RESTURLCombiner } from '../../core/url-combiner/rest-url-combiner';
import { URLCombiner } from '../../core/url-combiner/url-combiner';
/**
* This component renders the value of "handle"
* This component builds a URL from the value of "handle"
*/
@Component({
......@@ -22,7 +19,7 @@ export class ComcolPageHandleComponent {
// Optional title
@Input() title: string;
// The content to render.
// The value of "handle"
@Input() content: string;
constructor(@Inject(GLOBAL_CONFIG) private EnvConfig: GlobalConfig) {
......@@ -31,8 +28,7 @@ export class ComcolPageHandleComponent {
return new RESTURLCombiner(this.EnvConfig, '/').toString();
}
public getHandle(content: string): string {
const href = new URLCombiner(this.getRootHref(), '/handle/', this.content).toString();
return href;
return new URLCombiner(this.getRootHref(), '/handle/', this.content).toString();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment