更改URL位置上单击该分区 [英] change url location on click the div
本文介绍了更改URL位置上单击该分区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要上单击DIV改变位置。
I want to change location on clicking the div .
下面是code
<div class="divsub" ng-repeat="item1 in content" ng-click="go('/{{item1.title }}')">
<div class="divsubtitle"><a >{{item1.title}}</a></div>
<div class="divsubinner"></div>
<div class="divsublink">
<div style="float:left;text-decoration:underline;margin-left:19px">View Demo</div>
<div style="float:left;text-decoration:underline;margin-left:10px">Download</div>
</div>
</div>
下面是我的控制器
Below is my controller
first2.controller('nameListCtrl', function ($scope,urls_list)
{
$scope.content=urls_list;
$scope.go=function(path)
{
alert(path)
}
});
为什么警报不工作单击DIV
Why alert is not working on clicking the div
推荐答案
只需更改
ng-click="go('item1.title)"
到
ng-click="go(item1.title)"
下面是一个演示
这篇关于更改URL位置上单击该分区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文