Finds links in text input and turns them into html links. Supports http/https/ftp/mailto
and plain email address links.
Requires the ngSanitize
module to be installed.
Usage
In HTML Template Binding
<span ng-bind-html="linky_expression | linky"></span>
In JavaScript
$filter('linky')(text, target, attributes)
Arguments
Param | Type | Details |
---|---|---|
text | string | Input text. |
target | string | Window (_blank|_self|_parent|_top ) or named frame to open links in. |
attributes
(optional)
|
objectfunction(url) | Add custom attributes to the link element.
Can be one of:
|
Returns
string | Html-linkified and sanitized text. |
Snippet:
Filter Source Rendered linky filter Pretty text with some links:http://angularjs.org/,us@somewhere.org,another@somewhere.org, and one more: ftp://127.0.0.1/.linky target linky custom attributes no filter