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进行比较?