5 lines
30 KiB
JSON
5 lines
30 KiB
JSON
{
|
|
"id": "api/animations/query",
|
|
"title": "query",
|
|
"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/animations\", \"name\": \"@angular/animations\" } },\n { \"@type\": \"ListItem\", \"position\": 3, \"item\": { \"@id\": \"https://angular.io/api/animations/query\", \"name\": \"query\" } }\n ]\n }\n </script>\n <a href=\"/api\">API</a> > <a href=\"api/animations\">@angular/animations</a>\n </div>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/animations/src/animation_metadata.ts?message=docs(animations)%3A%20describe%20your%20change...#L1139-L1231\" 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/animations/src/animation_metadata.ts#L1139-L1231\" 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=\"query\">query<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/animations/query#query\"><i class=\"material-icons\">link</i></a></h1>\n \n <label class=\"api-type-label function\">function</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>Finds one or more inner elements within the current element that is\nbeing animated within a sequence. Use with <code><a href=\"api/animations/animate\" class=\"code-anchor\">animate</a>()</code>.</p>\n\n \n </section>\n \n \n \n\n <div class=\"overload-info\">\n \n\n <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box api-heading\"> <span class=\"member-name\"><a href=\"api/animations/query\" class=\"code-anchor\">query</a></span>(selector: string, <a href=\"api/animations/animation\" class=\"code-anchor\">animation</a>: <a href=\"api/animations/AnimationMetadata\" class=\"code-anchor\">AnimationMetadata</a> | <a href=\"api/animations/AnimationMetadata\" class=\"code-anchor\">AnimationMetadata</a>[], options: <a href=\"api/animations/AnimationQueryOptions\" class=\"code-anchor\">AnimationQueryOptions</a> = null): <a href=\"api/animations/AnimationQueryMetadata\" class=\"code-anchor\">AnimationQueryMetadata</a></code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters\">Parameters</h6>\n <table class=\"is-full-width list-table parameters-table function-overload-parameters\">\n <tbody>\n \n <tr class=\"function-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>selector</code>\n </td>\n <td class=\"param-type\"><code>string</code></td>\n <td class=\"param-description\">\n <p>The element to query, or a set of elements that contain Angular-specific\ncharacteristics, specified with one or more of the following tokens.</p>\n<ul>\n<li><code><a href=\"api/animations/query\" class=\"code-anchor\">query</a>(\":enter\")</code> or <code><a href=\"api/animations/query\" class=\"code-anchor\">query</a>(\":leave\")</code> : Query for newly inserted/removed elements.</li>\n<li><code><a href=\"api/animations/query\" class=\"code-anchor\">query</a>(\":animating\")</code> : Query all currently animating elements.</li>\n<li><code><a href=\"api/animations/query\" class=\"code-anchor\">query</a>(\"@triggerName\")</code> : Query elements that contain an animation trigger.</li>\n<li><code><a href=\"api/animations/query\" class=\"code-anchor\">query</a>(\"@*\")</code> : Query all elements that contain an animation triggers.</li>\n<li><code><a href=\"api/animations/query\" class=\"code-anchor\">query</a>(\":self\")</code> : Include the current element into the animation sequence.</li>\n</ul>\n\n </td>\n </tr>\n <tr class=\"function-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code><a href=\"api/animations/animation\" class=\"code-anchor\">animation</a></code>\n </td>\n <td class=\"param-type\"><code><a href=\"api/animations/AnimationMetadata\" class=\"code-anchor\">AnimationMetadata</a> | <a href=\"api/animations/AnimationMetadata\" class=\"code-anchor\">AnimationMetadata</a>[]</code></td>\n <td class=\"param-description\">\n <p>One or more animation steps to apply to the queried element or elements.\nAn array is treated as an animation sequence.</p>\n\n </td>\n </tr>\n <tr class=\"function-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>options</code>\n </td>\n <td class=\"param-type\"><code><a href=\"api/animations/AnimationQueryOptions\" class=\"code-anchor\">AnimationQueryOptions</a></code></td>\n <td class=\"param-description\">\n <p>An options object. Use the 'limit' field to limit the total number of\nitems to collect.</p>\n<p> Optional. Default is <code>null</code>.</p>\n\n </td>\n </tr>\n </tbody>\n</table>\n\n \n <h6 class=\"no-anchor\" id=\"returns\">Returns</h6>\n <p><code><a href=\"api/animations/AnimationQueryMetadata\" class=\"code-anchor\">AnimationQueryMetadata</a></code>: An object that encapsulates the query data.</p>\n \n \n\n\n \n\n \n</div>\n\n\n \n\n \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/animations/query#usage-notes\"><i class=\"material-icons\">link</i></a></h2>\n <p>Tokens can be merged into a combined query selector string. For example:</p>\n<code-example language=\"typescript\">\n <a href=\"api/animations/query\" class=\"code-anchor\">query</a>(':self, .record:enter, .record:leave, @subTrigger', [...])\n</code-example>\n<p>The <code><a href=\"api/animations/query\" class=\"code-anchor\">query</a>()</code> function collects multiple elements and works internally by using\n<code>element.querySelectorAll</code>. Use the <code>limit</code> field of an options object to limit\nthe total number of items to be collected. For example:</p>\n<code-example language=\"js\">\n<a href=\"api/animations/query\" class=\"code-anchor\">query</a>('div', [\n <a href=\"api/animations/animate\" class=\"code-anchor\">animate</a>(...),\n <a href=\"api/animations/animate\" class=\"code-anchor\">animate</a>(...)\n], { limit: 1 })\n</code-example>\n<p>By default, throws an error when zero items are found. Set the\n<code>optional</code> flag to ignore this error. For example:</p>\n<code-example language=\"js\">\n<a href=\"api/animations/query\" class=\"code-anchor\">query</a>('.some-element-that-may-not-be-there', [\n <a href=\"api/animations/animate\" class=\"code-anchor\">animate</a>(...),\n <a href=\"api/animations/animate\" class=\"code-anchor\">animate</a>(...)\n], { optional: true })\n</code-example>\n<h3 id=\"usage-example\">Usage Example<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/animations/query#usage-example\"><i class=\"material-icons\">link</i></a></h3>\n<p>The following example queries for inner elements and animates them\nindividually using <code><a href=\"api/animations/animate\" class=\"code-anchor\">animate</a>()</code>.</p>\n<code-example language=\"typescript\">\n@<a href=\"api/core/Component\" class=\"code-anchor\">Component</a>({\n selector: 'inner',\n template: `\n <div [@queryAnimation]=\"exp\">\n <h1><a href=\"api/platform-browser/Title\" class=\"code-anchor\">Title</a></h1>\n <div class=\"content\">\n Blah blah blah\n </div>\n </div>\n `,\n animations: [\n <a href=\"api/animations/trigger\" class=\"code-anchor\">trigger</a>('queryAnimation', [\n <a href=\"api/animations/transition\" class=\"code-anchor\">transition</a>('* => goAnimate', [\n // hide the inner elements\n <a href=\"api/animations/query\" class=\"code-anchor\">query</a>('h1', <a href=\"api/animations/style\" class=\"code-anchor\">style</a>({ opacity: 0 })),\n <a href=\"api/animations/query\" class=\"code-anchor\">query</a>('.content', <a href=\"api/animations/style\" class=\"code-anchor\">style</a>({ opacity: 0 })),\n\n // <a href=\"api/animations/animate\" class=\"code-anchor\">animate</a> the inner elements in, one by one\n <a href=\"api/animations/query\" class=\"code-anchor\">query</a>('h1', <a href=\"api/animations/animate\" class=\"code-anchor\">animate</a>(1000, <a href=\"api/animations/style\" class=\"code-anchor\">style</a>({ opacity: 1 }))),\n <a href=\"api/animations/query\" class=\"code-anchor\">query</a>('.content', <a href=\"api/animations/animate\" class=\"code-anchor\">animate</a>(1000, <a href=\"api/animations/style\" class=\"code-anchor\">style</a>({ opacity: 1 }))),\n ])\n ])\n ]\n})\nclass Cmp {\n exp = '';\n\n goAnimate() {\n this.exp = 'goAnimate';\n }\n}\n</code-example>\n\n</section>\n\n\n\n </div>\n</article>\n\n<!-- links to this doc:\n - api/animations\n - api/animations/AnimationMetadataType\n - api/animations/AnimationOptions\n - api/animations/AnimationQueryMetadata\n - api/animations/AnimationQueryOptions\n - api/animations/animateChild\n - api/animations/browser/AnimationDriver\n - api/animations/browser/testing/MockAnimationDriver\n - api/animations/stagger\n - api/animations/transition\n - api/animations/trigger\n - api/common/Location\n - api/common/testing/MockLocationStrategy\n - api/common/testing/SpyLocation\n - api/core/DebugElement\n - guide/animations\n - guide/complex-animation-sequences\n - guide/migration-dynamic-flag\n - guide/reusable-animations\n - guide/route-animations\n - guide/router\n - guide/router-tutorial-toh\n - guide/static-query-migration\n - guide/testing-components-scenarios\n - guide/testing-utility-apis\n - guide/transition-and-triggers\n - guide/upgrade\n-->\n<!-- links from this doc:\n - /api\n - api/animations\n - api/animations/AnimationMetadata\n - api/animations/AnimationQueryMetadata\n - api/animations/AnimationQueryOptions\n - api/animations/animate\n - api/animations/animation\n - api/animations/query#query\n - api/animations/query#usage-example\n - api/animations/query#usage-notes\n - api/animations/style\n - api/animations/transition\n - api/animations/trigger\n - api/core/Component\n - api/platform-browser/Title\n - https://github.com/angular/angular/edit/master/packages/animations/src/animation_metadata.ts?message=docs(animations)%3A%20describe%20your%20change...#L1139-L1231\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/animations/src/animation_metadata.ts#L1139-L1231\n-->"
|
|
} |