HI all,
I install InAppBrowser plugin and open hyperlink:
in controller:
var temp = “http://google/com.vn”;
$scope.textAndLink="Something here! "+"<a onClick='openWin(\""+temp+"\")'>"+temp+"</a>";
in html:
<script>
function openWin(sUrl) {
window.open(sUrl, '_blank', 'location=yes');
}
</script>
<pre ng-bind-html="textAndLink">{{textAndLink}}</pre>
But app run and i click this link, it does not run.
When i debug show source in F12 mode, it shows
<a class="">http://google/com.vn</a>
I try some solutions but it is not correct.
Help me, please!
Add inAppBrowser plugin
in HTML Page
<a href="#" ng-click=“OpenUrlFunction()”>
in Controller function
$scope.OpenUrlFunction = function() {
if ($scope.openurl) {
window.open($scope.openurl, “_system”);
}
}
Yes, but in this link:
$scope.textAndLink="Something here! "+"<a onClick='openWin(\""+temp+"\")'>"+temp+"</a>";
We have text or many links in link, and we want to open link when click on link?
Yes, but in this link:
$scope.textAndLink="Something here! "+"<a onClick='openWin(\""+temp+"\")'>"+temp+"</a>";
We have text or many links in link, and we want to open link when click on link?
change your text as
$scope.textAndLink=“Something here! “+”<a ng-click='openWin(”"+temp+"")’ href="#">"+temp+"</a>";