Angular location

来源:互联网 发布:软件英文缩写 编辑:程序博客网 时间:2024/05/24 05:01
function($location) {  // open http://example.com/base/index.html#!/a  $location.absUrl() == 'http://example.com/base/index.html#!/a'  $location.path() == '/a'  $location.path('/foo')  $location.absUrl() == 'http://example.com/base/index.html#!/foo'  $location.search() == {}  $location.search({a: 'b', c: true});  $location.absUrl() == 'http://example.com/base/index.html#!/foo?a=b&c'  $location.path('/new').search('x=y');  $location.absUrl() == 'http://example.com/base/index.html#!/new?x=y'}));

from : https://docs.angularjs.org/guide/$location
Address: http://www.example.com/base/path?a=b#h


$location.protocol() = http $location.host() = www.example.com $location.port() = 80 $location.path() = /path $location.search() = {"a":"b"} $location.hash() = h 
0 0
原创粉丝点击