Convert text from href links into ng-click.
//input: <a href="xxx">
//output: <a ng-click="GotoLink('xxx')">
function convert2ngclick(str) {
var res = str.replace(/<a href=\"(.+?)\">/g, '<a ng-click="GotoLink(\'$1\')">');
return res;
}
Awesome. Was searching for this from many days.. Thanks a lot!!
ReplyDeleteIm using the below code. All dynamic links inside content opening fine(opening in in-app browser). But twitter links not opening in in-app-browser. Twitter links navigating to file:///android_asset/www/index.html. Any help???
ReplyDeletehttps://pastebin.com/ZWHmdXuP