5 lines
256 KiB
JSON

{
"id": "api/common/testing/SpyLocation",
"title": "SpyLocation",
"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/testing\", \"name\": \"@angular/common/testing\" } },\n { \"@type\": \"ListItem\", \"position\": 4, \"item\": { \"@id\": \"https://angular.io/api/common/testing/SpyLocation\", \"name\": \"SpyLocation\" } }\n ]\n }\n </script>\n <a href=\"/api\">API</a> > <a href=\"api/common\">@angular/common</a> > <a href=\"api/common/testing\">@angular/common/testing</a>\n </div>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/common/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L12-L150\" 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/testing/src/location_mock.ts#L12-L150\" 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=\"spylocation\">SpyLocation<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/testing/SpyLocation#spylocation\"><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 spy for <a href=\"api/common/Location\"><code>Location</code></a> that allows tests to fire simulated location events.</p>\n\n \n </section>\n \n \n \n <section class=\"class-overview\">\n<code-example language=\"ts\" hidecopy=\"true\">\nclass <a href=\"api/common/testing/SpyLocation\" class=\"code-anchor\">SpyLocation</a> implements <a class=\"code-anchor\" href=\"api/common/Location\">Location</a> {\n <a class=\"code-anchor\" href=\"api/common/testing/SpyLocation#urlChanges\"><span class=\"member-name\">urlChanges</span>: string[]</a>\n <a class=\"code-anchor\" href=\"api/common/testing/SpyLocation#setInitialPath\"><span class=\"member-name\">setInitialPath</span>(url: string)</a>\n <a class=\"code-anchor\" href=\"api/common/testing/SpyLocation#setBaseHref\"><span class=\"member-name\">setBaseHref</span>(url: string)</a>\n <a class=\"code-anchor\" href=\"api/common/testing/SpyLocation#path\"><span class=\"member-name\">path</span>(): string</a>\n <a class=\"code-anchor\" href=\"api/common/testing/SpyLocation#getState\"><span class=\"member-name\">getState</span>(): unknown</a>\n <a class=\"code-anchor\" href=\"api/common/testing/SpyLocation#isCurrentPathEqualTo\"><span class=\"member-name\">isCurrentPathEqualTo</span>(path: string, query: string = ''): boolean</a>\n <a class=\"code-anchor\" href=\"api/common/testing/SpyLocation#simulateUrlPop\"><span class=\"member-name\">simulateUrlPop</span>(pathname: string)</a>\n <a class=\"code-anchor\" href=\"api/common/testing/SpyLocation#simulateHashChange\"><span class=\"member-name\">simulateHashChange</span>(pathname: string)</a>\n <a class=\"code-anchor\" href=\"api/common/testing/SpyLocation#prepareExternalUrl\"><span class=\"member-name\">prepareExternalUrl</span>(url: string): string</a>\n <a class=\"code-anchor\" href=\"api/common/testing/SpyLocation#go\"><span class=\"member-name\">go</span>(path: string, query: string = '', state: any = null)</a>\n <a class=\"code-anchor\" href=\"api/common/testing/SpyLocation#replaceState\"><span class=\"member-name\">replaceState</span>(path: string, query: string = '', state: any = null)</a>\n <a class=\"code-anchor\" href=\"api/common/testing/SpyLocation#forward\"><span class=\"member-name\">forward</span>()</a>\n <a class=\"code-anchor\" href=\"api/common/testing/SpyLocation#back\"><span class=\"member-name\">back</span>()</a>\n <a class=\"code-anchor\" href=\"api/common/testing/SpyLocation#onUrlChange\"><span class=\"member-name\">onUrlChange</span>(fn: (url: string, state: unknown) => void)</a>\n <a class=\"code-anchor\" href=\"api/common/testing/SpyLocation#subscribe\"><span class=\"member-name\">subscribe</span>(onNext: (value: any) => void, onThrow?: (error: any) => void, onReturn?: () => void): SubscriptionLike</a>\n <a class=\"code-anchor\" href=\"api/common/testing/SpyLocation#normalize\"><span class=\"member-name\">normalize</span>(url: string): string</a>\n}\n</code-example>\n\n \n \n\n</section>\n\n\n \n\n \n \n \n\n\n\n\n\n\n\n\n<section class=\"instance-properties\">\n <h2 id=\"properties\">Properties<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/testing/SpyLocation#properties\"><i class=\"material-icons\">link</i></a></h2>\n <table class=\"is-full-width list-table property-table\">\n <thead>\n <tr>\n <th>Property</th>\n <th>Description</th>\n </tr>\n </thead>\n <tbody>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"urlChanges\"></a>\n <code class=\"\"><span class=\"member-name\">urlChanges</span>: string[]</code>\n </td>\n <td>\n \n \n \n </td>\n </tr>\n \n </tbody>\n </table>\n</section>\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/testing/SpyLocation#methods\"><i class=\"material-icons\">link</i></a></h2>\n \n <a id=\"setInitialPath\"></a>\n<table class=\"is-full-width method-table instance-method\">\n <thead><tr><th>\n <div class=\"with-github-links\">\n <h3 id=\"setinitialpath\">\n setInitialPath()\n \n <a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/testing/SpyLocation#setinitialpath\"><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/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L35-L38\" 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/testing/src/location_mock.ts#L35-L38\" 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\">setInitialPath</span>(url: string)</code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters\">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>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 </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=\"setBaseHref\"></a>\n<table class=\"is-full-width method-table instance-method\">\n <thead><tr><th>\n <div class=\"with-github-links\">\n <h3 id=\"setbasehref\">\n setBaseHref()\n \n <a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/testing/SpyLocation#setbasehref\"><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/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L39-L42\" 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/testing/src/location_mock.ts#L39-L42\" 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\">setBaseHref</span>(url: string)</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>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 </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=\"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/testing/SpyLocation#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/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L43-L46\" 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/testing/src/location_mock.ts#L43-L46\" 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>(): 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\">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=\"getState\"></a>\n<table class=\"is-full-width method-table instance-method\">\n <thead><tr><th>\n <div class=\"with-github-links\">\n <h3 id=\"getstate\">\n getState()\n \n <a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/testing/SpyLocation#getstate\"><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/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L47-L50\" 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/testing/src/location_mock.ts#L47-L50\" 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\">getState</span>(): unknown</code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters-3\">Parameters</h6>\n <p>There are no parameters.</p>\n\n \n <h6 class=\"no-anchor\" id=\"returns-1\">Returns</h6>\n <p><code>unknown</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=\"isCurrentPathEqualTo\"></a>\n<table class=\"is-full-width method-table instance-method\">\n <thead><tr><th>\n <div class=\"with-github-links\">\n <h3 id=\"iscurrentpathequalto\">\n isCurrentPathEqualTo()\n \n <a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/testing/SpyLocation#iscurrentpathequalto\"><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/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L51-L58\" 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/testing/src/location_mock.ts#L51-L58\" 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\">isCurrentPathEqualTo</span>(path: string, <a href=\"api/animations/query\" class=\"code-anchor\">query</a>: string = ''): boolean</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>path</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><a href=\"api/animations/query\" class=\"code-anchor\">query</a></code>\n </td>\n <td class=\"param-type\"><code>string</code></td>\n <td class=\"param-description\">\n <p>Optional. Default is <code>''</code>.</p>\n \n </td>\n </tr>\n </tbody>\n</table>\n\n \n <h6 class=\"no-anchor\" id=\"returns-2\">Returns</h6>\n <p><code>boolean</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=\"simulateUrlPop\"></a>\n<table class=\"is-full-width method-table instance-method\">\n <thead><tr><th>\n <div class=\"with-github-links\">\n <h3 id=\"simulateurlpop\">\n simulateUrlPop()\n \n <a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/testing/SpyLocation#simulateurlpop\"><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/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L59-L62\" 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/testing/src/location_mock.ts#L59-L62\" 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\">simulateUrlPop</span>(pathname: 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>pathname</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=\"simulateHashChange\"></a>\n<table class=\"is-full-width method-table instance-method\">\n <thead><tr><th>\n <div class=\"with-github-links\">\n <h3 id=\"simulatehashchange\">\n simulateHashChange()\n \n <a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/testing/SpyLocation#simulatehashchange\"><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/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L63-L69\" 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/testing/src/location_mock.ts#L63-L69\" 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\">simulateHashChange</span>(pathname: 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>pathname</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=\"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/testing/SpyLocation#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/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L70-L76\" 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/testing/src/location_mock.ts#L70-L76\" 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>(url: string): string</code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters-7\">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>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 </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=\"go\"></a>\n<table class=\"is-full-width method-table instance-method\">\n <thead><tr><th>\n <div class=\"with-github-links\">\n <h3 id=\"go\">\n go()\n \n <a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/testing/SpyLocation#go\"><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/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L77-L95\" 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/testing/src/location_mock.ts#L77-L95\" 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\">go</span>(path: string, <a href=\"api/animations/query\" class=\"code-anchor\">query</a>: string = '', <a href=\"api/animations/state\" class=\"code-anchor\">state</a>: any = null)</code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters-8\">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>path</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><a href=\"api/animations/query\" class=\"code-anchor\">query</a></code>\n </td>\n <td class=\"param-type\"><code>string</code></td>\n <td class=\"param-description\">\n <p>Optional. Default is <code>''</code>.</p>\n \n </td>\n </tr>\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 <p>Optional. Default is <code>null</code>.</p>\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/testing/SpyLocation#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/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L96-L111\" 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/testing/src/location_mock.ts#L96-L111\" 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>(path: string, <a href=\"api/animations/query\" class=\"code-anchor\">query</a>: string = '', <a href=\"api/animations/state\" class=\"code-anchor\">state</a>: any = null)</code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters-9\">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>path</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><a href=\"api/animations/query\" class=\"code-anchor\">query</a></code>\n </td>\n <td class=\"param-type\"><code>string</code></td>\n <td class=\"param-description\">\n <p>Optional. Default is <code>''</code>.</p>\n \n </td>\n </tr>\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 <p>Optional. Default is <code>null</code>.</p>\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/testing/SpyLocation#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/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L112-L118\" 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/testing/src/location_mock.ts#L112-L118\" 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>()</code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters-10\">Parameters</h6>\n <p>There are no parameters.</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/testing/SpyLocation#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/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L119-L125\" 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/testing/src/location_mock.ts#L119-L125\" 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>()</code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters-11\">Parameters</h6>\n <p>There are no parameters.</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=\"onUrlChange\"></a>\n<table class=\"is-full-width method-table instance-method\">\n <thead><tr><th>\n <div class=\"with-github-links\">\n <h3 id=\"onurlchange\">\n onUrlChange()\n \n <a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/testing/SpyLocation#onurlchange\"><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/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L126-L134\" 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/testing/src/location_mock.ts#L126-L134\" 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\">onUrlChange</span>(fn: (url: string, <a href=\"api/animations/state\" class=\"code-anchor\">state</a>: unknown) => void)</code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters-12\">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>(url: string, <a href=\"api/animations/state\" class=\"code-anchor\">state</a>: unknown) => void</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=\"subscribe\"></a>\n<table class=\"is-full-width method-table instance-method\">\n <thead><tr><th>\n <div class=\"with-github-links\">\n <h3 id=\"subscribe\">\n subscribe()\n \n <a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/testing/SpyLocation#subscribe\"><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/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L140-L145\" 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/testing/src/location_mock.ts#L140-L145\" 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\">subscribe</span>(onNext: (value: any) => void, onThrow?: (error: any) => void, onReturn?: () => void): SubscriptionLike</code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters-13\">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>onNext</code>\n </td>\n <td class=\"param-type\"><code>(value: any) => void</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>onThrow</code>\n </td>\n <td class=\"param-type\"><code>(error: any) => void</code></td>\n <td class=\"param-description\">\n <p>Optional. Default is <code>undefined</code>.</p>\n \n </td>\n </tr>\n <tr class=\"instance-method-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>onReturn</code>\n </td>\n <td class=\"param-type\"><code>() => void</code></td>\n <td class=\"param-description\">\n <p>Optional. Default is <code>undefined</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>SubscriptionLike</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=\"normalize\"></a>\n<table class=\"is-full-width method-table instance-method\">\n <thead><tr><th>\n <div class=\"with-github-links\">\n <h3 id=\"normalize\">\n normalize()\n \n <a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/testing/SpyLocation#normalize\"><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/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L146-L149\" 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/testing/src/location_mock.ts#L146-L149\" 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\">normalize</span>(url: string): string</code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters-14\">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>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 </tbody>\n</table>\n\n \n <h6 class=\"no-anchor\" id=\"returns-5\">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</section>\n\n\n\n \n\n\n </div>\n</article>\n\n<!-- links to this doc:\n - api/common/Location\n - api/common/testing\n - api/router/testing/RouterTestingModule\n - guide/upgrade\n-->\n<!-- links from this doc:\n - /api\n - api/animations/query\n - api/animations/state\n - api/common\n - api/common/Location\n - api/common/testing\n - api/common/testing/SpyLocation#back\n - api/common/testing/SpyLocation#forward\n - api/common/testing/SpyLocation#getState\n - api/common/testing/SpyLocation#getstate\n - api/common/testing/SpyLocation#go\n - api/common/testing/SpyLocation#isCurrentPathEqualTo\n - api/common/testing/SpyLocation#iscurrentpathequalto\n - api/common/testing/SpyLocation#methods\n - api/common/testing/SpyLocation#normalize\n - api/common/testing/SpyLocation#onUrlChange\n - api/common/testing/SpyLocation#onurlchange\n - api/common/testing/SpyLocation#path\n - api/common/testing/SpyLocation#prepareExternalUrl\n - api/common/testing/SpyLocation#prepareexternalurl\n - api/common/testing/SpyLocation#properties\n - api/common/testing/SpyLocation#replaceState\n - api/common/testing/SpyLocation#replacestate\n - api/common/testing/SpyLocation#setBaseHref\n - api/common/testing/SpyLocation#setInitialPath\n - api/common/testing/SpyLocation#setbasehref\n - api/common/testing/SpyLocation#setinitialpath\n - api/common/testing/SpyLocation#simulateHashChange\n - api/common/testing/SpyLocation#simulateUrlPop\n - api/common/testing/SpyLocation#simulatehashchange\n - api/common/testing/SpyLocation#simulateurlpop\n - api/common/testing/SpyLocation#spylocation\n - api/common/testing/SpyLocation#subscribe\n - api/common/testing/SpyLocation#urlChanges\n - https://github.com/angular/angular/edit/master/packages/common/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L112-L118\n - https://github.com/angular/angular/edit/master/packages/common/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L119-L125\n - https://github.com/angular/angular/edit/master/packages/common/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L12-L150\n - https://github.com/angular/angular/edit/master/packages/common/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L126-L134\n - https://github.com/angular/angular/edit/master/packages/common/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L140-L145\n - https://github.com/angular/angular/edit/master/packages/common/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L146-L149\n - https://github.com/angular/angular/edit/master/packages/common/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L35-L38\n - https://github.com/angular/angular/edit/master/packages/common/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L39-L42\n - https://github.com/angular/angular/edit/master/packages/common/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L43-L46\n - https://github.com/angular/angular/edit/master/packages/common/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L47-L50\n - https://github.com/angular/angular/edit/master/packages/common/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L51-L58\n - https://github.com/angular/angular/edit/master/packages/common/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L59-L62\n - https://github.com/angular/angular/edit/master/packages/common/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L63-L69\n - https://github.com/angular/angular/edit/master/packages/common/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L70-L76\n - https://github.com/angular/angular/edit/master/packages/common/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L77-L95\n - https://github.com/angular/angular/edit/master/packages/common/testing/src/location_mock.ts?message=docs(common)%3A%20describe%20your%20change...#L96-L111\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/testing/src/location_mock.ts#L112-L118\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/testing/src/location_mock.ts#L119-L125\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/testing/src/location_mock.ts#L12-L150\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/testing/src/location_mock.ts#L126-L134\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/testing/src/location_mock.ts#L140-L145\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/testing/src/location_mock.ts#L146-L149\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/testing/src/location_mock.ts#L35-L38\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/testing/src/location_mock.ts#L39-L42\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/testing/src/location_mock.ts#L43-L46\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/testing/src/location_mock.ts#L47-L50\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/testing/src/location_mock.ts#L51-L58\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/testing/src/location_mock.ts#L59-L62\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/testing/src/location_mock.ts#L63-L69\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/testing/src/location_mock.ts#L70-L76\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/testing/src/location_mock.ts#L77-L95\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/testing/src/location_mock.ts#L96-L111\n-->"
}