Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我的网址 -charts/53d25d91959679701e362f25当我添加?widget=true到该链接时,charts/53d25d91959679701e362f25?widget=true我必须在charts/53d25d91959679701e362f25页面中隐藏两个特定的 div。
charts/53d25d91959679701e362f25
?widget=true
charts/53d25d91959679701e362f25?widget=true
我已经尝试过 -ng-if="location.path()"但不适用于?widget=true
ng-if="location.path()"
您不能在指令中使用$location服务ng-if
$location
ng-if
用户$location设置一些范围并绑定ng-if到该范围变量。
if(angular.isDefined($location.search().widget)) { $scope.isHidden = true; } else { $scope.isHidden = false; } ng-if="isHidden"