Angular filter to linkify urls, "@" usernames, and hashtags.
npm install angular-linkifyAngular 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 via either bower, npm, CDN (jsDelivr) or downloaded files:
* bower install angular-linkify --save
* npm install angular-linkify --save
* use CDN file
* download angular-linkify.zip
Include angular-linkify.min.js in your angular application
``html
`
Inject module into your application
`javascript`
angular.module('YourApp', ['linkify']);
Use as a AngularJS Directive
`html
Inject as a AngularJS Service
`javascript
// Injected into controller
angular.module('someModule').controller('SomeCtrl', function ($scope, linkify, $sce) {
var text = "@scottcorgan and http://github.com";
// Twitter
// Must use $sce.trustAsHtml() as of Angular 1.2.x
$scope.text = $sce.trustAsHtml(linkify.twitter(text));
// outputs: scottcorgan and http://github.com
// Github
// Must use $sce.trustAsHtml() as of Angular 1.2.x
$scope.text = $sce.trustAsHtml(linkify.github(text));
// outputs: scottcorgan and http://github.com
});`Build
`
grunt
``