【发布时间】:2014-07-28 01:31:07
【问题描述】:
我的 index.html 中有一个最初必须隐藏的 div:
<div class="autocomplete" ng-show="div_show" ng-controller="SearchController">
当我点击搜索链接上的菜单时,我需要显示的 div,基本上是
ng-show="true"
所以在我的链接上我定义了类似的东西:
<a class="list-group-item" ng-click="show()"><i class="fa fa-search fa-fw"></i> Search</a>
在我的控制器中,函数:
$scope.div_show = false;
$scope.show =function(){
$scope.div_show = true;
console.log($scope.div_show);
alert($scope.div_show);
}
当我点击链接时,我将警报值设置为“true”,但 div 仍然隐藏,
有什么建议吗?谢谢!!!
【问题讨论】:
-
不同的控制器?
标签: javascript html angularjs model-view-controller