5 lines
256 KiB
JSON
Raw Permalink Normal View History

{
"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: a
}