0

I have an Angular 2 form with a textarea field like

<div class="textarea-btn-holder form-group form-group-replace">
    <textarea autoGrow class="form-control text-comment" placeholder="Description" 
            name="description" [(ngModel)]="taskDescription" ></textarea>
</div>

I'm getting description from Rest API like

private taskDescription:string="Some data";

In some cases I get URL link as string, for example "https://......." So what I want is, if the string is hyperlink I want to make it as hyperlink and it should open in a new tab. And I want this hyperlink to be displayed inside textarea field only. How do I achieve this?

Protagonist
  • 1,649
  • 7
  • 34
  • 56
  • Its not possible your question is already asked here http://stackoverflow.com/questions/8082991/href-inside-textarea – Babar Hussain Mar 27 '17 at 10:04
  • Possible duplicate of [HREF inside TEXTAREA?](http://stackoverflow.com/questions/8082991/href-inside-textarea) – AT82 Mar 27 '17 at 19:13
  • You're gonna have to sanitize & use innerHTML probably in a div. – Chrillewoodz Mar 29 '17 at 08:34
  • Answer already exist in this question, please search before submit: https://stackoverflow.com/questions/39561181/binding-the-value-in-a-textarea – Mahmoud Kassem Jul 01 '17 at 04:59
  • Possible duplicate of [Binding the value in a textarea](https://stackoverflow.com/questions/39561181/binding-the-value-in-a-textarea) – Mahmoud Kassem Jul 01 '17 at 04:59

0 Answers0