Skip to content

Instantly share code, notes, and snippets.

@rishabhmhjn
rishabhmhjn / tweetLinky.js
Last active Jun 5, 2020
This is an AngularJS filter to linkify #hashtags and @mention texts into respective Twitter URLsDemo - http://plnkr.co/edit/vrdgxU?p=preview
View tweetLinky.js
var app = angular.module('tLinky', ['ngSanitize']);
app.filter('tweetLinky',['$filter', '$sce',
function($filter, $sce) {
return function(text, target) {
if (!text) return text;
var replacedText = $filter('linky')(text, target);
var targetAttr = "";
if (angular.isDefined(target)) {