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

Handle component: UIURLCombiner

parent 4f6b81ea
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="{{getHandle(content)}}">{{getHandle(content)}}</a></div>
<div class="d-inline-block "><a href="{{getHandle()}}">{{getHandle()}}</a></div>
</div>
import { Component, Input, Inject, Injectable } from '@angular/core';
import { GlobalConfig } from '../../../config/global-config.interface';
import { GLOBAL_CONFIG } from '../../../config';
import { RESTURLCombiner } from '../../core/url-combiner/rest-url-combiner';
import { URLCombiner } from '../../core/url-combiner/url-combiner';
import { UIURLCombiner } from '../../core/url-combiner/ui-url-combiner';
/**
* This component builds a URL from the value of "handle"
*/
......@@ -24,11 +23,7 @@ export class ComcolPageHandleComponent {
constructor(@Inject(GLOBAL_CONFIG) private EnvConfig: GlobalConfig) {
}
protected getRootHref(): string {
return new RESTURLCombiner(this.EnvConfig, '/').toString();
public getHandle(): string {
return new UIURLCombiner(this.EnvConfig, '/handle/', this.content).toString();
}
public getHandle(content: string): string {
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