$location.path(path) vs $location.url(url) in AngularJS

后端 未结 2 1965
时光取名叫无心
时光取名叫无心 2021-02-02 09:37

I\'ve seen these calls:

$location.url(\'/path/to/something/\' + id + \'/index\');

and

$location.path(\'/path/to/something/\' +         


        
2条回答
  •  臣服心动
    2021-02-02 10:03

    $location.path() allows you to extract out a specific part of your depending on your search string after the slash and excluding the parameters I guess. And if you don't have a search string then it works the same way as the $location.url() method does.

提交回复
热议问题