离子项目内的离子HREF在真正的Android设备不工作
我有一个<离子项目>
与< A>
里面。我想应用到具体的的href
在<离子项目方式>
点击
I have a <ion-item>
with <a>
inside it. I want the apps go to specific href
when the <ion-item>
is clicked.
在code在浏览器仿真器(离子服务
),但它不能被点击的Android真实设备上。
The code is working perfectly in browser emulator (ionic serve
), but it cant be clicked on the android real device.
这是我的&LT;离子项目&GT;
:
<ion-item>
<a href="http://google.com">
<img src="img/ionic.png">
<p>Events</p>
</a>
</ion-item>
请注意,上面的的href
进入外部HTML。
Note that the above href
goes to external html.
的的href
工作,如果我尝试去当地 HTML
:
The href
is working if i try to go to local html
:
<ion-item>
<a href="#/jobs">
<img src="img/ionic.png">
<p>Jobs List</p>
</a>
</ion-item>
我曾尝试改变的href
到 NG-HREF
,我也尝试指定 HREF
的离子项目在
标记。他们没有工作。
I have tried change href
to ng-href
, i also tried specify the href
inside the ion-item
tag. None of them is working.
我也试图改变的顺序 HTML
:
<a href="http://google.com">
<ion-item>
<img src="img/ionic.png">
<p>Forum</p>
</ion-item>
</a>
它仍然没有工作。
Its still not working.
请好心帮我,感谢您的帮助。
Please kindly help me, Thanks for your help
更新
我也试过用 inappbrowser
:
<ion-item>
<a href="#"
onclick="window.open('http://google.com', '_system', 'location=yes'); return false;">
<img src="img/ionic.png">
<p>Guide</p>
</a>
</ion-item>
但在实际设备上没有运气
But no luck on the real device
您可以在科尔多瓦的 http://ngcordova.com/docs/plugins/inAppBrowser/
如果你不想,只是使用$ window.open(' http://google.com '_system');在您的控制器
or if you don't want, just use $window.open('http://google.com', '_system'); in your controller
来源:的http://forum.ionicframework.com/t/linking-to-an-external-url-and-opening-in-browser/30953