angular-cn/aio/dist/generated/docs/api/common/PathLocationStrategy.json

5 lines
227 KiB
JSON

{
"id": "api/common/PathLocationStrategy",
"title": "PathLocationStrategy",
"contents": "\n\n<article>\n <div class=\"breadcrumb-container\">\n <div class=\"breadcrumb\">\n <script type=\"application/ld+json\">\n {\n \"@context\": \"http://schema.org\",\n \"@type\": \"BreadcrumbList\",\n \"itemListElement\": [\n { \"@type\": \"ListItem\", \"position\": 1, \"item\": { \"@id\": \"https://angular.io//api\", \"name\": \"API\" } },\n { \"@type\": \"ListItem\", \"position\": 2, \"item\": { \"@id\": \"https://angular.io/api/common\", \"name\": \"@angular/common\" } },\n { \"@type\": \"ListItem\", \"position\": 3, \"item\": { \"@id\": \"https://angular.io/api/common/PathLocationStrategy\", \"name\": \"PathLocationStrategy\" } }\n ]\n }\n </script>\n <a href=\"/api\">API</a> > <a href=\"api/common\">@angular/common</a>\n </div>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/common/src/location/location_strategy.ts?message=docs(common)%3A%20describe%20your%20change...#L75-L172\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/location/location_strategy.ts#L75-L172\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n </div>\n \n <header class=\"api-header\">\n <h1 id=\"pathlocationstrategy\">PathLocationStrategy<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/PathLocationStrategy#pathlocationstrategy\"><i class=\"material-icons\">link</i></a></h1>\n \n <label class=\"api-type-label class\">class</label>\n \n \n \n </header>\n \n <aio-toc class=\"embedded\"></aio-toc>\n\n <div class=\"api-body\">\n \n <section class=\"short-description\">\n <p>A <a href=\"api/common/LocationStrategy\"><code>LocationStrategy</code></a> used to configure the <a href=\"api/common/Location\"><code>Location</code></a> service to\nrepresent its state in the\n<a href=\"https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax\">path</a> of the\nbrowser's URL.</p>\n\n <p><a href=\"api/common/PathLocationStrategy#description\">See more...</a></p>\n </section>\n \n \n \n <section class=\"class-overview\">\n<code-example language=\"ts\" hidecopy=\"true\">\nclass <a href=\"api/common/PathLocationStrategy\" class=\"code-anchor\">PathLocationStrategy</a> extends <a class=\"code-anchor\" href=\"api/common/LocationStrategy\">LocationStrategy</a> implements <a class=\"code-anchor\" href=\"api/core/OnDestroy\">OnDestroy</a> {\n <a class=\"code-anchor\" href=\"api/common/PathLocationStrategy#ngOnDestroy\"><span class=\"member-name\">ngOnDestroy</span>(): void</a>\n <a class=\"code-anchor\" href=\"api/common/PathLocationStrategy#onPopState\"><span class=\"member-name\">onPopState</span>(fn: LocationChangeListener): void</a>\n <a class=\"code-anchor\" href=\"api/common/PathLocationStrategy#getBaseHref\"><span class=\"member-name\">getBaseHref</span>(): string</a>\n <a class=\"code-anchor\" href=\"api/common/PathLocationStrategy#prepareExternalUrl\"><span class=\"member-name\">prepareExternalUrl</span>(internal: string): string</a>\n <a class=\"code-anchor\" href=\"api/common/PathLocationStrategy#path\"><span class=\"member-name\">path</span>(includeHash: boolean = false): string</a>\n <a class=\"code-anchor\" href=\"api/common/PathLocationStrategy#pushState\"><span class=\"member-name\">pushState</span>(state: any, title: string, url: string, queryParams: string)</a>\n <a class=\"code-anchor\" href=\"api/common/PathLocationStrategy#replaceState\"><span class=\"member-name\">replaceState</span>(state: any, title: string, url: string, queryParams: string)</a>\n <a class=\"code-anchor\" href=\"api/common/PathLocationStrategy#forward\"><span class=\"member-name\">forward</span>(): void</a>\n <a class=\"code-anchor\" href=\"api/common/PathLocationStrategy#back\"><span class=\"member-name\">back</span>(): void</a>\n\n // inherited from <a class=\"code-anchor\" href=\"api/common/LocationStrategy\">common/LocationStrategy</a>\n <a class=\"code-anchor\" href=\"api/common/LocationStrategy#path\">abstract <span class=\"member-name\">path</span>(includeHash?: boolean): string</a>\n <a class=\"code-anchor\" href=\"api/common/LocationStrategy#prepareExternalUrl\">abstract <span class=\"member-name\">prepareExternalUrl</span>(internal: string): string</a>\n <a class=\"code-anchor\" href=\"api/common/LocationStrategy#pushState\">abstract <span class=\"member-name\">pushState</span>(state: any, title: string, url: string, queryParams: string): void</a>\n <a class=\"code-anchor\" href=\"api/common/LocationStrategy#replaceState\">abstract <span class=\"member-name\">replaceState</span>(state: any, title: string, url: string, queryParams: string): void</a>\n <a class=\"code-anchor\" href=\"api/common/LocationStrategy#forward\">abstract <span class=\"member-name\">forward</span>(): void</a>\n <a class=\"code-anchor\" href=\"api/common/LocationStrategy#back\">abstract <span class=\"member-name\">back</span>(): void</a>\n <a class=\"code-anchor\" href=\"api/common/LocationStrategy#onPopState\">abstract <span class=\"member-name\">onPopState</span>(fn: LocationChangeListener): void</a>\n <a class=\"code-anchor\" href=\"api/common/LocationStrategy#getBaseHref\">abstract <span class=\"member-name\">getBaseHref</span>(): string</a>\n}\n</code-example>\n\n \n \n\n</section>\n\n\n \n\n \n \n<section class=\"description\">\n <h2 id=\"description\">Description<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/PathLocationStrategy#description\"><i class=\"material-icons\">link</i></a></h2>\n <p>If you're using <code><a href=\"api/common/PathLocationStrategy\" class=\"code-anchor\">PathLocationStrategy</a></code>, you must provide a <a href=\"api/common/APP_BASE_HREF\"><code>APP_BASE_HREF</code></a>\nor add a <code>&#x3C;base href></code> element to the document.</p>\n<p>For instance, if you provide an <code><a href=\"api/common/APP_BASE_HREF\" class=\"code-anchor\">APP_BASE_HREF</a></code> of <code>'/my/app/'</code> and call\n<code>location.go('/foo')</code>, the browser's URL will become\n<code>example.com/my/app/foo</code>. To ensure all relative URIs resolve correctly,\nthe <code>&#x3C;base href></code> and/or <code><a href=\"api/common/APP_BASE_HREF\" class=\"code-anchor\">APP_BASE_HREF</a></code> should end with a <code>/</code>.</p>\n<p>Similarly, if you add <code>&#x3C;base href='/my/app/'/></code> to the document and call\n<code>location.go('/foo')</code>, the browser's URL will become\n<code>example.com/my/app/foo</code>.</p>\n<p>Note that when using <code><a href=\"api/common/PathLocationStrategy\" class=\"code-anchor\">PathLocationStrategy</a></code>, neither the query nor\nthe fragment in the <code>&#x3C;base href></code> will be preserved, as outlined\nby the <a href=\"https://tools.ietf.org/html/rfc3986#section-5.2.2\">RFC</a>.</p>\n\n <p>Further information available in the <a href=\"api/common/PathLocationStrategy#usage-notes\">Usage Notes</a>...</p>\n</section>\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n<section class=\"instance-methods\">\n <h2 id=\"methods\">Methods<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/PathLocationStrategy#methods\"><i class=\"material-icons\">link</i></a></h2>\n \n <a id=\"ngOnDestroy\"></a>\n<table class=\"is-full-width method-table instance-method\">\n <thead><tr><th>\n <div class=\"with-github-links\">\n <h3 id=\"ngondestroy\">\n ngOnDestroy()\n \n <a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/PathLocationStrategy#ngondestroy\"><i class=\"material-icons\">link</i></a></h3>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/common/src/location/location_strategy.ts?message=docs(common)%3A%20describe%20your%20change...#L128-L133\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/location/location_strategy.ts#L128-L133\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n </div>\n </th></tr></thead>\n <tbody>\n \n \n <tr>\n <td>\n <div class=\"overload-info\">\n \n\n <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box api-heading\"><span class=\"member-name\">ngOnDestroy</span>(): void</code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters\">Parameters</h6>\n <p>There are no parameters.</p>\n\n \n <h6 class=\"no-anchor\" id=\"returns\">Returns</h6>\n <p><code>void</code></p>\n\n \n\n\n \n\n \n</div>\n </td>\n </tr>\n \n\n \n\n \n </tbody>\n</table>\n\n \n <a id=\"onPopState\"></a>\n<table class=\"is-full-width method-table instance-method\">\n <thead><tr><th>\n <div class=\"with-github-links\">\n <h3 id=\"onpopstate\">\n onPopState()\n \n <a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/PathLocationStrategy#onpopstate\"><i class=\"material-icons\">link</i></a></h3>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/common/src/location/location_strategy.ts?message=docs(common)%3A%20describe%20your%20change...#L134-L138\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/location/location_strategy.ts#L134-L138\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n </div>\n </th></tr></thead>\n <tbody>\n \n \n <tr>\n <td>\n <div class=\"overload-info\">\n \n\n <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box api-heading\"><span class=\"member-name\">onPopState</span>(fn: <a href=\"api/common/LocationChangeListener\" class=\"code-anchor\">LocationChangeListener</a>): void</code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters-1\">Parameters</h6>\n <table class=\"is-full-width list-table parameters-table instance-method-overload-parameters\">\n <tbody>\n \n <tr class=\"instance-method-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>fn</code>\n </td>\n <td class=\"param-type\"><code><a href=\"api/common/LocationChangeListener\" class=\"code-anchor\">LocationChangeListener</a></code></td>\n <td class=\"param-description\">\n \n \n </td>\n </tr>\n </tbody>\n</table>\n\n \n <h6 class=\"no-anchor\" id=\"returns-1\">Returns</h6>\n <p><code>void</code></p>\n\n \n\n\n \n\n \n</div>\n </td>\n </tr>\n \n\n \n\n \n </tbody>\n</table>\n\n \n <a id=\"getBaseHref\"></a>\n<table class=\"is-full-width method-table instance-method\">\n <thead><tr><th>\n <div class=\"with-github-links\">\n <h3 id=\"getbasehref\">\n getBaseHref()\n \n <a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/PathLocationStrategy#getbasehref\"><i class=\"material-icons\">link</i></a></h3>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/common/src/location/location_strategy.ts?message=docs(common)%3A%20describe%20your%20change...#L139-L142\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/location/location_strategy.ts#L139-L142\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n </div>\n </th></tr></thead>\n <tbody>\n \n \n <tr>\n <td>\n <div class=\"overload-info\">\n \n\n <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box api-heading\"><span class=\"member-name\">getBaseHref</span>(): string</code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters-2\">Parameters</h6>\n <p>There are no parameters.</p>\n\n \n <h6 class=\"no-anchor\" id=\"returns-2\">Returns</h6>\n <p><code>string</code></p>\n\n \n\n\n \n\n \n</div>\n </td>\n </tr>\n \n\n \n\n \n </tbody>\n</table>\n\n \n <a id=\"prepareExternalUrl\"></a>\n<table class=\"is-full-width method-table instance-method\">\n <thead><tr><th>\n <div class=\"with-github-links\">\n <h3 id=\"prepareexternalurl\">\n prepareExternalUrl()\n \n <a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/PathLocationStrategy#prepareexternalurl\"><i class=\"material-icons\">link</i></a></h3>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/common/src/location/location_strategy.ts?message=docs(common)%3A%20describe%20your%20change...#L143-L146\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/location/location_strategy.ts#L143-L146\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n </div>\n </th></tr></thead>\n <tbody>\n \n \n <tr>\n <td>\n <div class=\"overload-info\">\n \n\n <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box api-heading\"><span class=\"member-name\">prepareExternalUrl</span>(internal: string): string</code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters-3\">Parameters</h6>\n <table class=\"is-full-width list-table parameters-table instance-method-overload-parameters\">\n <tbody>\n \n <tr class=\"instance-method-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>internal</code>\n </td>\n <td class=\"param-type\"><code>string</code></td>\n <td class=\"param-description\">\n \n \n </td>\n </tr>\n </tbody>\n</table>\n\n \n <h6 class=\"no-anchor\" id=\"returns-3\">Returns</h6>\n <p><code>string</code></p>\n\n \n\n\n \n\n \n</div>\n </td>\n </tr>\n \n\n \n\n \n </tbody>\n</table>\n\n \n <a id=\"path\"></a>\n<table class=\"is-full-width method-table instance-method\">\n <thead><tr><th>\n <div class=\"with-github-links\">\n <h3 id=\"path\">\n path()\n \n <a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/PathLocationStrategy#path\"><i class=\"material-icons\">link</i></a></h3>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/common/src/location/location_strategy.ts?message=docs(common)%3A%20describe%20your%20change...#L147-L153\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/location/location_strategy.ts#L147-L153\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n </div>\n </th></tr></thead>\n <tbody>\n \n \n <tr>\n <td>\n <div class=\"overload-info\">\n \n\n <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box api-heading\"><span class=\"member-name\">path</span>(includeHash: boolean = false): string</code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters-4\">Parameters</h6>\n <table class=\"is-full-width list-table parameters-table instance-method-overload-parameters\">\n <tbody>\n \n <tr class=\"instance-method-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>includeHash</code>\n </td>\n <td class=\"param-type\"><code>boolean</code></td>\n <td class=\"param-description\">\n <p>Optional. Default is <code>false</code>.</p>\n \n </td>\n </tr>\n </tbody>\n</table>\n\n \n <h6 class=\"no-anchor\" id=\"returns-4\">Returns</h6>\n <p><code>string</code></p>\n\n \n\n\n \n\n \n</div>\n </td>\n </tr>\n \n\n \n\n \n </tbody>\n</table>\n\n \n <a id=\"pushState\"></a>\n<table class=\"is-full-width method-table instance-method\">\n <thead><tr><th>\n <div class=\"with-github-links\">\n <h3 id=\"pushstate\">\n pushState()\n \n <a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/PathLocationStrategy#pushstate\"><i class=\"material-icons\">link</i></a></h3>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/common/src/location/location_strategy.ts?message=docs(common)%3A%20describe%20your%20change...#L154-L158\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/location/location_strategy.ts#L154-L158\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n </div>\n </th></tr></thead>\n <tbody>\n \n \n <tr>\n <td>\n <div class=\"overload-info\">\n \n\n <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box api-heading\"><span class=\"member-name\">pushState</span>(<a href=\"api/animations/state\" class=\"code-anchor\">state</a>: any, title: string, url: string, queryParams: string)</code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters-5\">Parameters</h6>\n <table class=\"is-full-width list-table parameters-table instance-method-overload-parameters\">\n <tbody>\n \n <tr class=\"instance-method-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code><a href=\"api/animations/state\" class=\"code-anchor\">state</a></code>\n </td>\n <td class=\"param-type\"><code>any</code></td>\n <td class=\"param-description\">\n \n \n </td>\n </tr>\n <tr class=\"instance-method-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>title</code>\n </td>\n <td class=\"param-type\"><code>string</code></td>\n <td class=\"param-description\">\n \n \n </td>\n </tr>\n <tr class=\"instance-method-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>url</code>\n </td>\n <td class=\"param-type\"><code>string</code></td>\n <td class=\"param-description\">\n \n \n </td>\n </tr>\n <tr class=\"instance-method-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>queryParams</code>\n </td>\n <td class=\"param-type\"><code>string</code></td>\n <td class=\"param-description\">\n \n \n </td>\n </tr>\n </tbody>\n</table>\n\n \n\n\n \n\n \n</div>\n </td>\n </tr>\n \n\n \n\n \n </tbody>\n</table>\n\n \n <a id=\"replaceState\"></a>\n<table class=\"is-full-width method-table instance-method\">\n <thead><tr><th>\n <div class=\"with-github-links\">\n <h3 id=\"replacestate\">\n replaceState()\n \n <a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/PathLocationStrategy#replacestate\"><i class=\"material-icons\">link</i></a></h3>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/common/src/location/location_strategy.ts?message=docs(common)%3A%20describe%20your%20change...#L159-L163\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/location/location_strategy.ts#L159-L163\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n </div>\n </th></tr></thead>\n <tbody>\n \n \n <tr>\n <td>\n <div class=\"overload-info\">\n \n\n <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box api-heading\"><span class=\"member-name\">replaceState</span>(<a href=\"api/animations/state\" class=\"code-anchor\">state</a>: any, title: string, url: string, queryParams: string)</code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters-6\">Parameters</h6>\n <table class=\"is-full-width list-table parameters-table instance-method-overload-parameters\">\n <tbody>\n \n <tr class=\"instance-method-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code><a href=\"api/animations/state\" class=\"code-anchor\">state</a></code>\n </td>\n <td class=\"param-type\"><code>any</code></td>\n <td class=\"param-description\">\n \n \n </td>\n </tr>\n <tr class=\"instance-method-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>title</code>\n </td>\n <td class=\"param-type\"><code>string</code></td>\n <td class=\"param-description\">\n \n \n </td>\n </tr>\n <tr class=\"instance-method-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>url</code>\n </td>\n <td class=\"param-type\"><code>string</code></td>\n <td class=\"param-description\">\n \n \n </td>\n </tr>\n <tr class=\"instance-method-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>queryParams</code>\n </td>\n <td class=\"param-type\"><code>string</code></td>\n <td class=\"param-description\">\n \n \n </td>\n </tr>\n </tbody>\n</table>\n\n \n\n\n \n\n \n</div>\n </td>\n </tr>\n \n\n \n\n \n </tbody>\n</table>\n\n \n <a id=\"forward\"></a>\n<table class=\"is-full-width method-table instance-method\">\n <thead><tr><th>\n <div class=\"with-github-links\">\n <h3 id=\"forward\">\n forward()\n \n <a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/PathLocationStrategy#forward\"><i class=\"material-icons\">link</i></a></h3>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/common/src/location/location_strategy.ts?message=docs(common)%3A%20describe%20your%20change...#L164-L167\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/location/location_strategy.ts#L164-L167\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n </div>\n </th></tr></thead>\n <tbody>\n \n \n <tr>\n <td>\n <div class=\"overload-info\">\n \n\n <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box api-heading\"><span class=\"member-name\">forward</span>(): void</code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters-7\">Parameters</h6>\n <p>There are no parameters.</p>\n\n \n <h6 class=\"no-anchor\" id=\"returns-5\">Returns</h6>\n <p><code>void</code></p>\n\n \n\n\n \n\n \n</div>\n </td>\n </tr>\n \n\n \n\n \n </tbody>\n</table>\n\n \n <a id=\"back\"></a>\n<table class=\"is-full-width method-table instance-method\">\n <thead><tr><th>\n <div class=\"with-github-links\">\n <h3 id=\"back\">\n back()\n \n <a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/PathLocationStrategy#back\"><i class=\"material-icons\">link</i></a></h3>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/common/src/location/location_strategy.ts?message=docs(common)%3A%20describe%20your%20change...#L168-L171\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/location/location_strategy.ts#L168-L171\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n </div>\n </th></tr></thead>\n <tbody>\n \n \n <tr>\n <td>\n <div class=\"overload-info\">\n \n\n <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box api-heading\"><span class=\"member-name\">back</span>(): void</code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters-8\">Parameters</h6>\n <p>There are no parameters.</p>\n\n \n <h6 class=\"no-anchor\" id=\"returns-6\">Returns</h6>\n <p><code>void</code></p>\n\n \n\n\n \n\n \n</div>\n </td>\n </tr>\n \n\n \n\n \n </tbody>\n</table>\n\n \n</section>\n\n\n\n \n<section class=\"usage-notes\">\n <h2 id=\"usage-notes\">Usage notes<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/PathLocationStrategy#usage-notes\"><i class=\"material-icons\">link</i></a></h2>\n <h3 id=\"example\">Example<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/PathLocationStrategy#example\"><i class=\"material-icons\">link</i></a></h3>\n<code-example path=\"common/location/ts/path_location_component.ts\" region=\"LocationComponent\">\nimport {<a href=\"api/common/Location\" class=\"code-anchor\">Location</a>, <a href=\"api/common/LocationStrategy\" class=\"code-anchor\">LocationStrategy</a>, <a href=\"api/common/PathLocationStrategy\" class=\"code-anchor\">PathLocationStrategy</a>} from '@angular/common';\nimport {<a href=\"api/core/Component\" class=\"code-anchor\">Component</a>} from '@angular/core';\n\n@<a href=\"api/core/Component\" class=\"code-anchor\">Component</a>({\n selector: 'path-location',\n providers: [<a href=\"api/common/Location\" class=\"code-anchor\">Location</a>, {provide: <a href=\"api/common/LocationStrategy\" class=\"code-anchor\">LocationStrategy</a>, useClass: <a href=\"api/common/PathLocationStrategy\" class=\"code-anchor\">PathLocationStrategy</a>}],\n template: `\n &#x3C;h1><a href=\"api/common/PathLocationStrategy\" class=\"code-anchor\">PathLocationStrategy</a>&#x3C;/h1>\n Current URL is: &#x3C;code>{{location.path()}}&#x3C;/code>&#x3C;br>\n Normalize: &#x3C;code>/foo/bar/&#x3C;/code> is: &#x3C;code>{{location.normalize('foo/bar')}}&#x3C;/code>&#x3C;br>\n `\n})\nexport class PathLocationComponent {\n location: <a href=\"api/common/Location\" class=\"code-anchor\">Location</a>;\n constructor(location: <a href=\"api/common/Location\" class=\"code-anchor\">Location</a>) {\n this.location = location;\n }\n}\n\n</code-example>\n\n</section>\n\n\n\n </div>\n</article>\n\n<!-- links to this doc:\n - api/common\n - api/common/APP_BASE_HREF\n - api/common/Location\n - api/common/LocationStrategy\n - api/common/upgrade/LocationUpgradeConfig\n - api/core/OnDestroy\n - api/router/upgrade/setUpLocationSync\n - guide/router\n-->\n<!-- links from this doc:\n - /api\n - api/animations/state\n - api/common\n - api/common/APP_BASE_HREF\n - api/common/Location\n - api/common/LocationChangeListener\n - api/common/LocationStrategy\n - api/common/LocationStrategy#back\n - api/common/LocationStrategy#forward\n - api/common/LocationStrategy#getBaseHref\n - api/common/LocationStrategy#onPopState\n - api/common/LocationStrategy#path\n - api/common/LocationStrategy#prepareExternalUrl\n - api/common/LocationStrategy#pushState\n - api/common/LocationStrategy#replaceState\n - api/common/PathLocationStrategy#back\n - api/common/PathLocationStrategy#description\n - api/common/PathLocationStrategy#example\n - api/common/PathLocationStrategy#forward\n - api/common/PathLocationStrategy#getBaseHref\n - api/common/PathLocationStrategy#getbasehref\n - api/common/PathLocationStrategy#methods\n - api/common/PathLocationStrategy#ngOnDestroy\n - api/common/PathLocationStrategy#ngondestroy\n - api/common/PathLocationStrategy#onPopState\n - api/common/PathLocationStrategy#onpopstate\n - api/common/PathLocationStrategy#path\n - api/common/PathLocationStrategy#pathlocationstrategy\n - api/common/PathLocationStrategy#prepareExternalUrl\n - api/common/PathLocationStrategy#prepareexternalurl\n - api/common/PathLocationStrategy#pushState\n - api/common/PathLocationStrategy#pushstate\n - api/common/PathLocationStrategy#replaceState\n - api/common/PathLocationStrategy#replacestate\n - api/common/PathLocationStrategy#usage-notes\n - api/core/Component\n - api/core/OnDestroy\n - https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax\n - https://github.com/angular/angular/edit/master/packages/common/src/location/location_strategy.ts?message=docs(common)%3A%20describe%20your%20change...#L128-L133\n - https://github.com/angular/angular/edit/master/packages/common/src/location/location_strategy.ts?message=docs(common)%3A%20describe%20your%20change...#L134-L138\n - https://github.com/angular/angular/edit/master/packages/common/src/location/location_strategy.ts?message=docs(common)%3A%20describe%20your%20change...#L139-L142\n - https://github.com/angular/angular/edit/master/packages/common/src/location/location_strategy.ts?message=docs(common)%3A%20describe%20your%20change...#L143-L146\n - https://github.com/angular/angular/edit/master/packages/common/src/location/location_strategy.ts?message=docs(common)%3A%20describe%20your%20change...#L147-L153\n - https://github.com/angular/angular/edit/master/packages/common/src/location/location_strategy.ts?message=docs(common)%3A%20describe%20your%20change...#L154-L158\n - https://github.com/angular/angular/edit/master/packages/common/src/location/location_strategy.ts?message=docs(common)%3A%20describe%20your%20change...#L159-L163\n - https://github.com/angular/angular/edit/master/packages/common/src/location/location_strategy.ts?message=docs(common)%3A%20describe%20your%20change...#L164-L167\n - https://github.com/angular/angular/edit/master/packages/common/src/location/location_strategy.ts?message=docs(common)%3A%20describe%20your%20change...#L168-L171\n - https://github.com/angular/angular/edit/master/packages/common/src/location/location_strategy.ts?message=docs(common)%3A%20describe%20your%20change...#L75-L172\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/location/location_strategy.ts#L128-L133\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/location/location_strategy.ts#L134-L138\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/location/location_strategy.ts#L139-L142\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/location/location_strategy.ts#L143-L146\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/location/location_strategy.ts#L147-L153\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/location/location_strategy.ts#L154-L158\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/location/location_strategy.ts#L159-L163\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/location/location_strategy.ts#L164-L167\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/location/location_strategy.ts#L168-L171\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/location/location_strategy.ts#L75-L172\n - https://tools.ietf.org/html/rfc3986#section-5.2.2\n-->"
}