Nice :) Glad it worked out On Wednesday, 23 April 2014, Pertti Kellomäki <[email protected]> wrote:
> Hi Gabriel, > > I looked around a bit and found < > https://github.com/gregjacobs/Autolinker.js> which can create links from > URLs, email addresses and Twitter handles. I wrapped it in a directive like > this: > > .directive('autolinker', function () { > return { > restrict: 'E', > scope: { > text: '=' > }, > link: function (scope, element, attrs) { > scope.$watch("text", function (new_value) { > if (new_value != undefined) { > element.html(Autolinker.link(new_value, {email: false, twitter: false})); > } > }) > } > } > }) > > Pertti > > > On Wed, Apr 23, 2014 at 12:04 PM, Gabriel Aszalos < > [email protected]<javascript:_e(%7B%7D,'cvml','[email protected]');> > > wrote: > >> P.S. You could also use RegEx to do that. >> >> >> On Tuesday, 22 April 2014 14:42:58 UTC+1, Pertti Kellomäki wrote: >> >>> Does anyone happen to have a directive handy that would render a string >>> as plain text, but turn URLs into links? >>> -- >>> Pertti >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "AngularJS" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to >> [email protected]<javascript:_e(%7B%7D,'cvml','angular%[email protected]');> >> . >> To post to this group, send email to >> [email protected]<javascript:_e(%7B%7D,'cvml','[email protected]');> >> . >> Visit this group at http://groups.google.com/group/angular. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Pertti Kellomäki, Kesanto Enterprises > Your training in the cloud: <http://www.trainingcommons.com> > > -- > You received this message because you are subscribed to a topic in the > Google Groups "AngularJS" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/angular/DRypnFRQ4pg/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]<javascript:_e(%7B%7D,'cvml','angular%[email protected]');> > . > To post to this group, send email to > [email protected]<javascript:_e(%7B%7D,'cvml','[email protected]');> > . > Visit this group at http://groups.google.com/group/angular. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
