Skip to content

feat: if data has URL display it as hyperlink#140

Open
medjedovicm wants to merge 2 commits into
hivivo:mainfrom
medjedovicm:issue-132
Open

feat: if data has URL display it as hyperlink#140
medjedovicm wants to merge 2 commits into
hivivo:mainfrom
medjedovicm:issue-132

Conversation

@medjedovicm

Copy link
Copy Markdown

Resolves #131, resolves #132

Implementation

  • New segment type introduced link
  • Path or URL is detected and appropriate CSS is applied. (purple colour, text underlined)
  • In such case, the segment is clickable
  • When clicked, output event is fired: segmentLinkClicked payload is type string containing the clicked segment value

@RamonFlyboysGames RamonFlyboysGames left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment but I also want the feautre.

private isLink(value: string): boolean {
return value.substring(0, 8) === 'https://' ||
value.substring(0, 7) === 'http://' ||
value[0] === '/'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if this is changed to a RegExp, the scheme is not case sensitive, and is also posible http:(domain)
Reference

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I was delayed a bit. I pushed and would appreciate your review.

@medjedovicm

Copy link
Copy Markdown
Author

image

@MichaelDoyle

Copy link
Copy Markdown

I needed this feature (and other proposed features) for my own work, and ended up forking the project and modernizing it. I implemented url/link following, with the ability to override/provide custom "click handling" as desired.

https://github.com/MichaelDoyle/ngx-json-treeview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

If data has url how to display it as link (Hyperlink) Displaying hyperlinks

4 participants