angularjs'NG-的href'不工作 [英] angularjs 'ng-href' not working
本文介绍了angularjs'NG-的href'不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图创建一个链接到使用angularjs NG-的href每个ID,但是当我刷新页面,链接显示不出来。我甚至关闭浏览器,并清除缓存但什么也没有发生。这是我目前的code:
< TR NG重复=包裹在包裹>
< TD><一个NG-HREF =http://www.proj.com/ {{parcel.id}} /编辑//> {{包裹。
ID}}< / TD>
&所述; TD> {{parcel.tracking_id}}&下; / TD>
&所述; TD> {{parcel.shipper_ref_no}}&下; / TD>
$ scope.parcels = [];
$ scope.scans = [];
$ scope.missings = [];
$ scope.excludeds = [];$ scope.parcels = Outbound.summaryPageData.parcels;
$ scope.scans = Outbound.summaryPageData.scans;
$ scope.missings = Outbound.summaryPageData.missings;
$ scope.excludeds = Outbound.summaryPageData.excludeds;
});
解决方案
我认为这是一个简单的HTML语法错误 - 在< A>
标签没有内容。尝试改变这一点:
<一个NG-HREF =http://www.proj.com/ {{parcel.id}} /编辑//> {{} parcel.id }
到
<一个NG-HREF =http://www.proj.com/ {{parcel.id}} /编辑/> {{parcel.id}} &所述; / A>
I'm trying to create a link to each id using angularjs ng-href but when I refresh the page, the links don't show up. I even closed the browser and cleared the cache yet nothing is happening. Here is my current code:
<tr ng-repeat="parcel in parcels">
<td><a ng-href="http://www.proj.com/{{ parcel.id }}/edit/"/>{{ parcel.
id }}</td>
<td>{{ parcel.tracking_id }}</td>
<td>{{ parcel.shipper_ref_no }}</td>
$scope.parcels = [];
$scope.scans = [];
$scope.missings = [];
$scope.excludeds = [];
$scope.parcels = Outbound.summaryPageData.parcels;
$scope.scans = Outbound.summaryPageData.scans;
$scope.missings = Outbound.summaryPageData.missings;
$scope.excludeds = Outbound.summaryPageData.excludeds;
});
解决方案
I think it's a simple HTML syntax error - the <a>
tag has no content. Try changing this:
<a ng-href="http://www.proj.com/{{ parcel.id }}/edit/"/>{{ parcel.id }}
to:
<a ng-href="http://www.proj.com/{{ parcel.id }}/edit/">{{ parcel.id }}</a>
这篇关于angularjs'NG-的href'不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文