5 lines
27 KiB
JSON
5 lines
27 KiB
JSON
{
|
|
"id": "api/animations/state",
|
|
"title": "state",
|
|
"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/state\", \"name\": \"state\" } }\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...#L788-L822\" 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#L788-L822\" 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=\"state\">state<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/animations/state#state\"><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>Declares an animation state within a trigger attached to an element.</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/state\" class=\"code-anchor\">state</a></span>(name: string, styles: <a href=\"api/animations/AnimationStyleMetadata\" class=\"code-anchor\">AnimationStyleMetadata</a>, options?: { params: { [name: string]: any; }; }): <a href=\"api/animations/AnimationStateMetadata\" class=\"code-anchor\">AnimationStateMetadata</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>name</code>\n </td>\n <td class=\"param-type\"><code>string</code></td>\n <td class=\"param-description\">\n <p>One or more names for the defined state in a comma-separated string.\nThe following reserved state names can be supplied to define a style for specific use\ncases:</p>\n<ul>\n<li><code>void</code> You can associate styles with this name to be used when\nthe element is detached from the application. For example, when an <code><a href=\"api/common/NgIf\" class=\"code-anchor\">ngIf</a></code> evaluates\nto false, the state of the associated element is void.</li>\n<li><code>*</code> (asterisk) Indicates the default state. You can associate styles with this name\nto be used as the fallback when the state that is being animated is not declared\nwithin the trigger.</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>styles</code>\n </td>\n <td class=\"param-type\"><code><a href=\"api/animations/AnimationStyleMetadata\" class=\"code-anchor\">AnimationStyleMetadata</a></code></td>\n <td class=\"param-description\">\n <p>A set of CSS styles associated with this state, created using the\n<code><a href=\"api/animations/style\" class=\"code-anchor\">style</a>()</code> function.\nThis set of styles persists on the element once the state has been reached.</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>object</code></td>\n <td class=\"param-description\">\n <p>Parameters that can be passed to the state when it is invoked.\n0 or more key-value pairs.</p>\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\">Returns</h6>\n <p><code><a href=\"api/animations/AnimationStateMetadata\" class=\"code-anchor\">AnimationStateMetadata</a></code>: An object that encapsulates the new state 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/state#usage-notes\"><i class=\"material-icons\">link</i></a></h2>\n <p>Use the <code><a href=\"api/animations/trigger\" class=\"code-anchor\">trigger</a>()</code> function to register states to an animation trigger.\nUse the <code><a href=\"api/animations/transition\" class=\"code-anchor\">transition</a>()</code> function to animate between states.\nWhen a state is active within a component, its associated styles persist on the element,\neven when the animation ends.</p>\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/AnimationStateMetadata\n - api/animations/style\n - api/animations/transition\n - api/animations/trigger\n - api/common/HashLocationStrategy\n - api/common/Location\n - api/common/LocationChangeEvent\n - api/common/LocationStrategy\n - api/common/PathLocationStrategy\n - api/common/PlatformLocation\n - api/common/PopStateEvent\n - api/common/testing/MockPlatformLocation\n - api/common/testing/SpyLocation\n - api/common/upgrade/$locationShim\n - api/core/Component\n - api/forms/SelectControlValueAccessor\n - api/router/CanActivate\n - api/router/CanActivateChild\n - api/router/GuardsCheckEnd\n - api/router/GuardsCheckStart\n - api/router/NavigationBehaviorOptions\n - api/router/Resolve\n - api/router/ResolveEnd\n - api/router/ResolveStart\n - api/router/RouterLink\n - api/router/RouterLinkWithHref\n - api/router/RouterState\n - api/router/RouterStateSnapshot\n - api/router/RoutesRecognized\n - guide/animations\n - guide/binding-syntax\n - guide/built-in-directives\n - guide/complex-animation-sequences\n - guide/elements\n - guide/i18n\n - guide/lazy-loading-ngmodules\n - guide/property-binding\n - guide/reactive-forms\n - guide/router\n - guide/router-tutorial-toh\n - guide/service-worker-devops\n - guide/structural-directives\n - guide/template-typecheck\n - guide/transition-and-triggers\n - guide/zone\n-->\n<!-- links from this doc:\n - /api\n - api/animations\n - api/animations/AnimationStateMetadata\n - api/animations/AnimationStyleMetadata\n - api/animations/state#state\n - api/animations/state#usage-notes\n - api/animations/style\n - api/animations/transition\n - api/animations/trigger\n - api/common/NgIf\n - https://github.com/angular/angular/edit/master/packages/animations/src/animation_metadata.ts?message=docs(animations)%3A%20describe%20your%20change...#L788-L822\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/animations/src/animation_metadata.ts#L788-L822\n-->"
|
|
} |