2016-03-08 83 views
-1

我有这个问题,当我在网络浏览器上打开,但在我的android智能手机上打开时没有工作。ng-href从json打开页面不工作在应用程序

<ion-list> 
    <ion-item class="list" > 
    <a class="item item-thumbnail-left" ng-href="{{x.Adress}}" ng-repeat="x in names|orderBy:'Name'" > 
     <img ng-src="{{x.Image}}"> 
     <h2>{{x.Name}}</h2> 
     <p>{{x.Local}}</p> 
     <p>{{x.Descri}}</p> 
    </a> 
    </ion-item> 
</ion-list> 

.controller('PlaylistsCtrl', function($scope, $http) { 
 
    $http.get("patrocinadores.json") 
 
     .success(function (response) 
 
     { 
 
     $scope.names = response; 
 
     }); 
 
})

+0

你有错误? – AshBringer

+0

请加上控制器。 “名称”的外观如何? –

+0

在我的浏览器上返回0错误 – Sobucki

回答

0

尝试写地址无插值: 例如:

,并确认您的属性名称。在您的控制器

<ion-list> 
    <ion-item class="list" > 
<a class="item item-thumbnail-left" ng-click="Open(x.Adress)" ng-repeat="x in names|orderBy:'Name'" > 
    <img ng-src="{{x.Image}}"> 
    <h2>{{x.Name}}</h2> 
    <p>{{x.Local}}</p> 
    <p>{{x.Descri}}</p> 
</a> 

$scope.Open = function(url){ 
    window.open(url, '_system'); 
}; 

在你的 “” 标签,你需要设定目标不要忘记

或者你可以尝试(不花哨) attr“系统”加载或打开您的链接与默认的系统浏览器,而不是embebed离子视图。

我希望这可以帮助你。

+0

谢谢你,它的工作,非常感谢你。 – Sobucki

+0

不客气,喜欢编码! –

相关问题