Android 4.1股票浏览器:无法在新标签页中打开链接

时间:2013-12-06 17:46:09

标签: android html angularjs android-browser

我在新标签页中打开链接时遇到问题,特别是指向位置数据的Google地图的链接。它会在iOS 6/7上的新标签页和Chrome浏览器中打开。

以下是我正在使用的标签:

<a class="location" href="https://maps.google.com/maps?q={{ eventDetails.location.latitude }},{{ eventDetails.location.longitude }}" target="_blank">View on map</a>

模板来自AngularJS。我认为_blank足以让这个浏览器弹出一个新选项卡,但是页面加载在同一个窗口中。

该设备位于安装了Android 4.1.1的Galaxy S3上。用户代理字符串显示为AppleWebKit/534.30 Version/4.0 Mobile Safari/534.30

1 个答案:

答案 0 :(得分:0)

每当在url中使用数据绑定时,您应该使用ng-href而不是href。浏览器可能会链接到您的原始网址。如果您使用ng-href,只有在您的网址被角度正确呈现后,它才会生成链接。请参阅ng-href here

的文档