5 lines
9.7 KiB
JSON
5 lines
9.7 KiB
JSON
{
|
|
"id": "api/router/RouterEvent",
|
|
"title": "RouterEvent",
|
|
"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/router\", \"name\": \"@angular/router\" } },\n { \"@type\": \"ListItem\", \"position\": 3, \"item\": { \"@id\": \"https://angular.io/api/router/RouterEvent\", \"name\": \"RouterEvent\" } }\n ]\n }\n </script>\n <a href=\"/api\">API</a> > <a href=\"api/router\">@angular/router</a>\n </div>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/router/src/events.ts?message=docs(router)%3A%20describe%20your%20change...#L22-L51\" 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/router/src/events.ts#L22-L51\" 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=\"routerevent\">RouterEvent<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/RouterEvent#routerevent\"><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>Base for events the router goes through, as opposed to events tied to a specific\nroute. Fired one time for any given navigation.</p>\n\n <p><a href=\"api/router/RouterEvent#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/router/RouterEvent\" class=\"code-anchor\">RouterEvent</a> {\n <a class=\"code-anchor\" href=\"api/router/RouterEvent#constructor()\"><span class=\"member-name\">constructor</span>(id: number, url: string)</a>\n <a class=\"code-anchor\" href=\"api/router/RouterEvent#id\"><span class=\"member-name\">id</span>: number</a>\n <a class=\"code-anchor\" href=\"api/router/RouterEvent#url\"><span class=\"member-name\">url</span>: string</a>\n}\n</code-example>\n\n \n \n <div class=\"descendants class\">\n <h2 id=\"subclasses\">Subclasses<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/RouterEvent#subclasses\"><i class=\"material-icons\">link</i></a></h2>\n \n\n<ul>\n \n <li>\n <code><a href=\"api/router/GuardsCheckEnd\" class=\"code-anchor\">GuardsCheckEnd</a></code>\n \n\n\n </li>\n \n <li>\n <code><a href=\"api/router/GuardsCheckStart\" class=\"code-anchor\">GuardsCheckStart</a></code>\n \n\n\n </li>\n \n <li>\n <code><a href=\"api/router/NavigationCancel\" class=\"code-anchor\">NavigationCancel</a></code>\n \n\n\n </li>\n \n <li>\n <code><a href=\"api/router/NavigationEnd\" class=\"code-anchor\">NavigationEnd</a></code>\n \n\n\n </li>\n \n <li>\n <code><a href=\"api/router/NavigationError\" class=\"code-anchor\">NavigationError</a></code>\n \n\n\n </li>\n \n <li>\n <code><a href=\"api/router/NavigationStart\" class=\"code-anchor\">NavigationStart</a></code>\n \n\n\n </li>\n \n <li>\n <code><a href=\"api/router/ResolveEnd\" class=\"code-anchor\">ResolveEnd</a></code>\n \n\n\n </li>\n \n <li>\n <code><a href=\"api/router/ResolveStart\" class=\"code-anchor\">ResolveStart</a></code>\n \n\n\n </li>\n \n <li>\n <code><a href=\"api/router/RoutesRecognized\" class=\"code-anchor\">RoutesRecognized</a></code>\n \n\n\n </li>\n \n</ul>\n\n\n </div>\n \n\n</section>\n\n\n \n<section class=\"see-also\">\n <h2 id=\"see-also\">See also<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/RouterEvent#see-also\"><i class=\"material-icons\">link</i></a></h2>\n <ul>\n \n <li><p><code><a href=\"api/router/Event\" class=\"code-anchor\">Event</a></code></p>\n</li>\n <li><p><a href=\"guide/router#router-events\">Router events summary</a></p>\n</li>\n </ul>\n</section>\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/router/RouterEvent#description\"><i class=\"material-icons\">link</i></a></h2>\n <p>The following code shows how a class subscribes to router events.</p>\n<code-example language=\"ts\">\nclass MyService {\n constructor(public router: <a href=\"api/router/Router\" class=\"code-anchor\">Router</a>, logger: Logger) {\n router.events.pipe(\n filter((e: <a href=\"api/router/Event\" class=\"code-anchor\">Event</a>): e is <a href=\"api/router/RouterEvent\" class=\"code-anchor\">RouterEvent</a> => e instanceof <a href=\"api/router/RouterEvent\" class=\"code-anchor\">RouterEvent</a>)\n ).subscribe((e: <a href=\"api/router/RouterEvent\" class=\"code-anchor\">RouterEvent</a>) => {\n logger.log(e.id, e.url);\n });\n }\n}\n</code-example>\n\n \n</section>\n\n \n\n\n\n\n\n\n<h2 id=\"constructor\">Constructor<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/router/RouterEvent#constructor\"><i class=\"material-icons\">link</i></a></h2>\n<a id=\"constructor()\"></a>\n<table class=\"is-full-width method-table constructor\">\n \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\">constructor</span>(id: number, 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 constructor-overload-parameters\">\n <tbody>\n \n <tr class=\"constructor-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>id</code>\n </td>\n <td class=\"param-type\"><code><a href=\"api/common/DecimalPipe\" class=\"code-anchor\">number</a></code></td>\n <td class=\"param-description\">\n <p>A unique ID that the router assigns to every router navigation.</p>\n \n </td>\n </tr>\n <tr class=\"constructor-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 <p>The URL that is the destination for this navigation.</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\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/router/RouterEvent#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=\"id\"></a>\n <code class=\"\"><span class=\"member-name\">id</span>: number</code>\n </td>\n <td>\n <span class=\"from-constructor\">Declared in Constructor</span>\n <p>A unique ID that the router assigns to every router navigation.</p>\n\n \n </td>\n </tr>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"url\"></a>\n <code class=\"\"><span class=\"member-name\">url</span>: string</code>\n </td>\n <td>\n <span class=\"from-constructor\">Declared in Constructor</span>\n <p>The URL that is the destination for this navigation.</p>\n\n \n </td>\n </tr>\n \n </tbody>\n </table>\n</section>\n\n\n\n\n\n \n\n\n </div>\n</article>\n\n<!-- links to this doc:\n - api/router\n - api/router/Event\n - api/router/GuardsCheckEnd\n - api/router/GuardsCheckStart\n - api/router/NavigationCancel\n - api/router/NavigationEnd\n - api/router/NavigationError\n - api/router/NavigationStart\n - api/router/ResolveEnd\n - api/router/ResolveStart\n - api/router/RoutesRecognized\n-->\n<!-- links from this doc:\n - /api\n - api/common/DecimalPipe\n - api/router\n - api/router/Event\n - api/router/GuardsCheckEnd\n - api/router/GuardsCheckStart\n - api/router/NavigationCancel\n - api/router/NavigationEnd\n - api/router/NavigationError\n - api/router/NavigationStart\n - api/router/ResolveEnd\n - api/router/ResolveStart\n - api/router/Router\n - api/router/RouterEvent#constructor\n - api/router/RouterEvent#constructor()\n - api/router/RouterEvent#description\n - api/router/RouterEvent#id\n - api/router/RouterEvent#properties\n - api/router/RouterEvent#routerevent\n - api/router/RouterEvent#see-also\n - api/router/RouterEvent#subclasses\n - api/router/RouterEvent#url\n - api/router/RoutesRecognized\n - guide/router#router-events\n - https://github.com/angular/angular/edit/master/packages/router/src/events.ts?message=docs(router)%3A%20describe%20your%20change...#L22-L51\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/router/src/events.ts#L22-L51\n-->"
|
|
} |