这是我的网址 - charts/53d25d91959679701e362f25
,当我将?widget=true
添加到该链接charts/53d25d91959679701e362f25?widget=true
时,我必须在charts/53d25d91959679701e362f25
页面中隐藏两个特定的div。
我已尝试过 - ng-if="location.path()"
但不适用于?widget=true
答案 0 :(得分:0)
您无法在$location
指令
ng-if
服务
用户$location
设置一些范围并将ng-if
绑定到该范围变量。
if(angular.isDefined($location.search().widget)) {
$scope.isHidden = true;
}
else {
$scope.isHidden = false;
}
ng-if="isHidden"