matthewoh93 ASP.NET

Thursday, 17 December 2015

Phonegap - opening href links in a browser

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;
        }

Posted by Matthew Oh at 15:01 2 comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Blog Archive

  • ►  2022 (26)
    • ►  August (1)
    • ►  July (1)
    • ►  June (4)
    • ►  May (19)
    • ►  April (1)
  • ►  2021 (4)
    • ►  September (2)
    • ►  August (2)
  • ►  2020 (33)
    • ►  July (3)
    • ►  June (1)
    • ►  May (6)
    • ►  April (3)
    • ►  March (18)
    • ►  February (2)
  • ►  2019 (2)
    • ►  October (2)
  • ▼  2015 (14)
    • ▼  December (1)
      • Phonegap - opening href links in a browser
    • ►  November (3)
    • ►  October (7)
    • ►  September (3)
  • ►  2014 (11)
    • ►  October (1)
    • ►  April (3)
    • ►  February (3)
    • ►  January (4)
  • ►  2013 (9)
    • ►  December (1)
    • ►  November (3)
    • ►  October (1)
    • ►  September (1)
    • ►  August (2)
    • ►  March (1)
  • ►  2012 (6)
    • ►  July (1)
    • ►  June (1)
    • ►  May (3)
    • ►  April (1)
Picture Window theme. Powered by Blogger.