0
$scope.currentLocationPath = $location.path();
$scope.configUserPath = '/configUser';
http://myurl.com/#/configUser/
$scope.editUserPath = '/editUser';
http://myurl.com/#/editUser/1
<div ng-hide="(currentLocationPath === configUserPath || currentLocationPath === editUserPath)>do something</div>
我正在比較使用當前位置的路徑。對於沒有查詢字符串的網址,它的效果很好,但是它並沒有比較正確的URL和查詢字符串的路徑,如編輯用戶案例所示。AngularJS - 刪除查詢字符串和比較路徑
如何在editUser後刪除查詢字符串並將其與currentlocation進行比較?