mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Comcol Handle component
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<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>
|
||||
|
@@ -1,13 +1,10 @@
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user