linky – filter in module ngSanitize

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.


In HTML Template Binding

<span ng-bind-html="linky_expression | linky"></span>

In JavaScript

$filter('linky')(text, target, attributes)


Param Type Details
text string Input text.
target string Window (_blank|_self|_parent|_top) or named frame to open links in.

objectfunction(url) Add custom attributes to the link element.

Can be one of:

  • object: A map of attributes
  • function: Takes the url as a parameter and returns a map of attributes

    If the map of attributes contains a value for target, it overrides the value of the target parameter.


string Html-linkified and sanitized text.



Filter Source Rendered
linky filter
linky target
linky custom attributes
no filter



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s