Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-linkify

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-linkify

Angular filter to linkify urls, "@" usernames, and hashtags.

  • 0.3.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
720
decreased by-19.73%
Maintainers
1
Weekly downloads
 
Created
Source

angular-linkify

Angular filter, directive, and service to linkify text. As of v0.3.0, angular-linkify works for twitter/github mentions, twitter hashtags, and basic urls.

Install

bower install angular-linkify --save

Usage

Inject module into your application

angular.module('YourApp', ['linkify']);

Use as a AngularJS Filter or AngularJS Directive

<!-- As a filter -->
<div ng-controller="SomeCtrl">
  <div ng-bind-html-unsave="someValue | linkify"></div> <!-- linkified!! -->
</div>

<!-- As a filter, with twitter parsing -->
<div ng-controller="SomeCtrl">
  <div ng-bind-html-unsave="someValue | linkify:'twitter'"></div> <!-- linkified!! -->
</div>

<!-- As a directive, no twitter -->
<div ng-bind="someModel" linkify></div>

<!-- As a directive, with twitter parsing -->
<div ng-bind="someModel" linkify="twitter"></div>

Inject as a AngularJS Service

// Injected into controller
angular.module('someModule').controller('SomeCtrl', function ($scope, linkify) {
  var text = "@scottcorgan and http://github.com";
  
  // Twitter
  $scope.text = linkify.twitter(text);
  // outputs: <a href="https://twitter.com/scottcorgan" target="_blank">scottcorgan</a> and <a href="http://github.com" target="_blank">http://github.com</a>
  
  // Github
  $scope.text = linkify.github(text);
  // outputs: <a href="https://github.com/scottcorgan" target="_blank">scottcorgan</a> and <a href="http://github.com" target="_blank">http://github.com</a>
  
});

Build

grunt

Keywords

FAQs

Package last updated on 07 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc