# `path` ( service in module `ng` )

## Description

This method is getter / setter.

Return path of current url when called without any parameter.

Change path when called with parameter and return `$location` .

Note: Path should always begin with forward slash (/), this method will add the forward slash if it is missing.

## Parameters

- `path(optional) – {string=} –`

  New path

## Returns

`{string}` –

path