ember-source 7.1.0-beta.1 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-metadata.json +3 -3
- package/dist/dev/packages/@ember/-internals/glimmer/index.js +5 -5
- package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +1 -1
- package/dist/dev/packages/@ember/application/index.js +1 -1
- package/dist/dev/packages/@ember/application/instance.js +1 -1
- package/dist/dev/packages/@ember/array/index.js +4 -0
- package/dist/dev/packages/@ember/component/helper.js +1 -1
- package/dist/dev/packages/@ember/component/index.js +9 -3
- package/dist/dev/packages/@ember/engine/index.js +1 -1
- package/dist/dev/packages/@ember/helper/index.js +4 -23
- package/dist/dev/packages/@ember/modifier/on.js +1 -1
- package/dist/dev/packages/@ember/object/index.js +22 -17
- package/dist/dev/packages/@ember/renderer/index.js +1 -1
- package/dist/dev/packages/@ember/routing/index.js +8 -4
- package/dist/dev/packages/@ember/routing/route.js +1 -1
- package/dist/dev/packages/@ember/routing/router-service.js +19 -12
- package/dist/dev/packages/@ember/template-compiler/lib/compile-options.js +3 -3
- package/dist/dev/packages/@glimmer/runtime/index.js +4 -4
- package/dist/dev/packages/ember/version.js +1 -1
- package/dist/dev/packages/shared-chunks/{element-DQJOvSlQ.js → element-Cf3hqNOD.js} +2 -0
- package/dist/dev/packages/shared-chunks/{get-D5b5QlqE.js → get-BehtPmsu.js} +30 -33
- package/dist/dev/packages/shared-chunks/{hash-BRRFQJ99.js → hash-BTwOuDGQ.js} +15 -9
- package/dist/dev/packages/shared-chunks/{helper-Do7NCZHI.js → helper-BubrhyuN.js} +18 -6
- package/dist/dev/packages/shared-chunks/{index-CwnQYqK5.js → index-CL1zjHwo.js} +80 -102
- package/dist/dev/packages/shared-chunks/{on-BueSMv9L.js → on-BQii6ILK.js} +6 -6
- package/dist/dev/packages/shared-chunks/{or-O0eJQ4K-.js → or-BTH3yuFG.js} +1 -1
- package/dist/dev/packages/shared-chunks/{setup-registry-BC5VMvei.js → setup-registry-BQZJfq-Y.js} +2 -2
- package/dist/dev/packages/shared-chunks/{textarea-WSlUEr0y.js → textarea-lD4apgrP.js} +6 -2
- package/dist/prod/packages/@ember/-internals/glimmer/index.js +5 -5
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +1 -1
- package/dist/prod/packages/@ember/application/index.js +1 -1
- package/dist/prod/packages/@ember/application/instance.js +1 -1
- package/dist/prod/packages/@ember/array/index.js +4 -0
- package/dist/prod/packages/@ember/component/helper.js +1 -1
- package/dist/prod/packages/@ember/component/index.js +9 -3
- package/dist/prod/packages/@ember/engine/index.js +1 -1
- package/dist/prod/packages/@ember/helper/index.js +4 -23
- package/dist/prod/packages/@ember/modifier/on.js +1 -1
- package/dist/prod/packages/@ember/object/index.js +22 -17
- package/dist/prod/packages/@ember/renderer/index.js +1 -1
- package/dist/prod/packages/@ember/routing/index.js +8 -4
- package/dist/prod/packages/@ember/routing/route.js +1 -1
- package/dist/prod/packages/@ember/routing/router-service.js +19 -12
- package/dist/prod/packages/@ember/template-compiler/lib/compile-options.js +3 -3
- package/dist/prod/packages/@glimmer/runtime/index.js +4 -4
- package/dist/prod/packages/ember/version.js +1 -1
- package/dist/prod/packages/shared-chunks/{element-DUOVW5Ho.js → element-9DRa_9dO.js} +2 -0
- package/dist/prod/packages/shared-chunks/{get-t0-itmA-.js → get-Dt5L0TcU.js} +30 -33
- package/dist/prod/packages/shared-chunks/{hash-mcs3pEFO.js → hash-Dkj3I4L4.js} +15 -9
- package/dist/prod/packages/shared-chunks/{helper-DLjV2ZZW.js → helper-CN6UzshW.js} +18 -6
- package/dist/prod/packages/shared-chunks/{index-qDFz6Mfe.js → index-ClxHbCe9.js} +80 -102
- package/dist/prod/packages/shared-chunks/{on-B5NVufs_.js → on-CWgOWNSL.js} +6 -6
- package/dist/prod/packages/shared-chunks/{or-3AxY5TPj.js → or-Crsa2wci.js} +1 -1
- package/dist/prod/packages/shared-chunks/{setup-registry-C2KfZJWI.js → setup-registry-B3DhqtxX.js} +2 -2
- package/dist/prod/packages/shared-chunks/{textarea-CHqL0Rdh.js → textarea-Byj32raR.js} +6 -2
- package/docs/data.json +180 -180
- package/package.json +3 -6
- package/types/stable/@ember/-internals/glimmer/index.d.ts +165 -121
- package/types/stable/@ember/-internals/glimmer/lib/component.d.ts +8 -2
- package/types/stable/@ember/-internals/glimmer/lib/glimmer-tracking-docs.d.ts +12 -12
- package/types/stable/@ember/-internals/glimmer/lib/helper.d.ts +18 -6
- package/types/stable/@ember/-internals/glimmer/lib/helpers/array.d.ts +3 -1
- package/types/stable/@ember/-internals/glimmer/lib/helpers/component.d.ts +65 -121
- package/types/stable/@ember/-internals/glimmer/lib/helpers/concat.d.ts +8 -4
- package/types/stable/@ember/-internals/glimmer/lib/helpers/each-in.d.ts +16 -14
- package/types/stable/@ember/-internals/glimmer/lib/helpers/element.d.ts +2 -0
- package/types/stable/@ember/-internals/glimmer/lib/helpers/fn.d.ts +11 -7
- package/types/stable/@ember/-internals/glimmer/lib/helpers/get.d.ts +23 -29
- package/types/stable/@ember/-internals/glimmer/lib/helpers/hash.d.ts +3 -1
- package/types/stable/@ember/-internals/glimmer/lib/helpers/if-unless.d.ts +95 -49
- package/types/stable/@ember/-internals/glimmer/lib/helpers/mut.d.ts +23 -54
- package/types/stable/@ember/-internals/glimmer/lib/helpers/page-title.d.ts +6 -2
- package/types/stable/@ember/-internals/glimmer/lib/helpers/readonly.d.ts +4 -8
- package/types/stable/@ember/-internals/glimmer/lib/modifiers/on.d.ts +10 -10
- package/types/stable/@ember/-internals/glimmer/lib/syntax/in-element.d.ts +2 -0
- package/types/stable/@ember/-internals/glimmer/lib/syntax/let.d.ts +2 -14
- package/types/stable/@ember/-internals/glimmer/lib/syntax/mount.d.ts +15 -11
- package/types/stable/@ember/-internals/glimmer/lib/syntax/outlet.d.ts +17 -10
- package/types/stable/@ember/-internals/runtime/lib/mixins/target_action_support.d.ts +1 -1
- package/types/stable/@ember/array/index.d.ts +4 -0
- package/types/stable/@ember/controller/index.d.ts +1 -1
- package/types/stable/@ember/helper/index.d.ts +0 -19
- package/types/stable/@ember/object/index.d.ts +4 -3
- package/types/stable/@ember/object/observable.d.ts +4 -0
- package/types/stable/@ember/routing/route.d.ts +1 -1
- package/types/stable/@ember/routing/router-service.d.ts +20 -12
- package/types/stable/@glimmer/runtime/lib/helpers/array.d.ts +1 -1
- package/types/stable/@glimmer/runtime/lib/helpers/concat.d.ts +8 -3
- package/types/stable/@glimmer/runtime/lib/helpers/fn.d.ts +13 -7
- package/types/stable/@glimmer/runtime/lib/helpers/get.d.ts +21 -29
- package/types/stable/@glimmer/runtime/lib/helpers/hash.d.ts +1 -1
- package/types/stable/@glimmer/syntax/lib/get-template-locals.d.ts +1 -1
- package/types/stable/@glimmer/tracking/index.d.ts +12 -12
package/docs/data.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "The Ember API",
|
|
4
4
|
"description": "The Ember API: a framework for building ambitious web applications",
|
|
5
5
|
"url": "https://emberjs.com/",
|
|
6
|
-
"version": "7.1.0
|
|
6
|
+
"version": "7.1.0"
|
|
7
7
|
},
|
|
8
8
|
"files": {
|
|
9
9
|
"node_modules/rsvp/lib/rsvp/promise/all.js": {
|
|
@@ -2609,7 +2609,7 @@
|
|
|
2609
2609
|
"tag": "main",
|
|
2610
2610
|
"file": "packages/@ember/-internals/glimmer/lib/helper.ts",
|
|
2611
2611
|
"line": 57,
|
|
2612
|
-
"description": "[Glimmer](https://github.com/tildeio/glimmer) is a templating engine used by Ember.js that is compatible with a subset of the [Handlebars](http://handlebarsjs.com/) syntax.\n\n### Showing a property\n\nTemplates manage the flow of an application's UI, and display state (through\nthe DOM) to a user. For example, given a component with the property \"name\",\nthat component's template can use the name in several ways:\n\n```app/components/person-profile.js\nimport Component from '@ember/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n @tracked name = 'Jill'\n}\n```\n\n```app/components/person-profile.hbs\n{{this.name}}\n<div>{{this.name}}</div>\n<span data-name={{this.name}}></span>\n```\n\nAny time the \"name\" property on the component changes, the DOM will be\nupdated.\n\nProperties can be chained as well:\n\n```handlebars\n{{@aUserModel.name}}\n<div>{{@listOfUsers.firstObject.name}}</div>\n```\n\n### Using Ember helpers\n\nWhen content is passed in mustaches `{{}}`, Ember will first try to find a helper\nor component with that name. For example, the `if` helper:\n\n```app/components/person-profile.hbs\n{{if this.name \"I have a name\" \"I have no name\"}}\n<span data-has-name={{if this.name true}}></span>\n```\n\nThe returned value is placed where the `{{}}` is called. The above style is\ncalled \"inline\". A second style of helper usage is called \"block\". For example:\n\n```handlebars\n{{#if this.name}}\n I have a name\n{{else}}\n I have no name\n{{/if}}\n```\n\nThe block form of helpers allows you to control how the UI is created based\non the values of properties.\nA third form of helper is called \"nested\". For example here the concat\nhelper will add \" Doe\" to a displayed name if the person has no last name:\n\n```handlebars\n<span data-name={{concat this.firstName (\n if this.lastName (concat \" \" this.lastName) \"Doe\"\n)}}></span>\n```\n\nEmber's built-in helpers are described under the [Ember.Templates.helpers](/ember/release/classes/Ember.Templates.helpers)\nnamespace. Documentation on creating custom helpers can be found under\n[helper](/ember/release/functions/@ember%2Fcomponent%2Fhelper/helper) (or\nunder [Helper](/ember/release/classes/Helper) if a helper requires access to\ndependency injection).\n\n### Invoking a Component\n\nEmber components represent state to the UI of an application. Further\nreading on components can be found under [Component](/ember/release/classes/Component).",
|
|
2612
|
+
"description": "[Glimmer](https://github.com/tildeio/glimmer) is a templating engine used by Ember.js that is compatible with a subset of the [Handlebars](http://handlebarsjs.com/) syntax.\n\nEmber ships with two types of JavaScript classes for components:\n\n1. Glimmer components, imported from `@glimmer/component`, which are the\ndefault component's for Ember Octane (3.15) and more recent editions.\n2. Classic components, imported from `@ember/component`, which were the\ndefault for older editions of Ember (pre 3.15) but are still supported.\n\nBelow is the documentation for Classic components. If you are looking for the\nAPI documentation for Template-only or Glimmer components, it is [available\nhere](/ember/release/modules/@glimmer%2Fcomponent).\n\nNote: Prior to Ember 6.8, by default, components were authored in paired `.hbs` and `.js`\nfiles. This is still supported, but the default authoring format is now `.gjs` or \"template tag\".\nThe documentation for `@ember/component` still refers to the older authoring format. To read about\nthe new authoring format, see the\n[Glimmer Component API documentation](/ember/release/modules/@glimmer%2Fcomponent).\n \n### Showing a property\n\nTemplates manage the flow of an application's UI, and display state (through\nthe DOM) to a user. For example, given a component with the property \"name\",\nthat component's template can use the name in several ways:\n\n```app/components/person-profile.js\nimport Component from '@ember/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n @tracked name = 'Jill'\n}\n```\n\n```app/components/person-profile.hbs\n{{this.name}}\n<div>{{this.name}}</div>\n<span data-name={{this.name}}></span>\n```\n\nAny time the \"name\" property on the component changes, the DOM will be\nupdated.\n\nProperties can be chained as well:\n\n```handlebars\n{{@aUserModel.name}}\n<div>{{@listOfUsers.firstObject.name}}</div>\n```\n\n### Using Ember helpers\n\nWhen content is passed in mustaches `{{}}`, Ember will first try to find a helper\nor component with that name. For example, the `if` helper:\n\n```app/components/person-profile.hbs\n{{if this.name \"I have a name\" \"I have no name\"}}\n<span data-has-name={{if this.name true}}></span>\n```\n\nThe returned value is placed where the `{{}}` is called. The above style is\ncalled \"inline\". A second style of helper usage is called \"block\". For example:\n\n```handlebars\n{{#if this.name}}\n I have a name\n{{else}}\n I have no name\n{{/if}}\n```\n\nThe block form of helpers allows you to control how the UI is created based\non the values of properties.\nA third form of helper is called \"nested\". For example here the concat\nhelper will add \" Doe\" to a displayed name if the person has no last name:\n\n```handlebars\n<span data-name={{concat this.firstName (\n if this.lastName (concat \" \" this.lastName) \"Doe\"\n)}}></span>\n```\n\nEmber's built-in helpers are described under the [Ember.Templates.helpers](/ember/release/classes/Ember.Templates.helpers)\nnamespace. Documentation on creating custom helpers can be found under\n[helper](/ember/release/functions/@ember%2Fcomponent%2Fhelper/helper) (or\nunder [Helper](/ember/release/classes/Helper) if a helper requires access to\ndependency injection).\n\n### Invoking a Component\n\nEmber components represent state to the UI of an application. Further\nreading on components can be found under [Component](/ember/release/classes/Component).",
|
|
2613
2613
|
"itemtype": "main",
|
|
2614
2614
|
"access": "public",
|
|
2615
2615
|
"tagname": ""
|
|
@@ -3355,7 +3355,7 @@
|
|
|
3355
3355
|
"tag": "module",
|
|
3356
3356
|
"file": "packages/@glimmer/component/dist/index.d.ts",
|
|
3357
3357
|
"line": 3,
|
|
3358
|
-
"description": "A component is a reusable UI element that consists of a `.hbs` template and an\noptional JavaScript class that defines its behavior. For example, someone\nmight make a `button` in the template and handle the click behavior in the\nJavaScript file that shares the same name as the template.\n\nComponents are broken down into two categories:\n\n- Components _without_ JavaScript, that are based only on a template. These\n are called Template-only or TO components.\n- Components _with_ JavaScript, which consist of a template and a backing\n class.\n\nEmber ships with two types of JavaScript classes for components:\n\n1. Glimmer components, imported from `@glimmer/component`, which are the\n default components for Ember Octane (3.15) and more recent editions.\n2. Classic components, imported from `@ember/component`, which were the\n default for older editions of Ember (pre 3.15).\n\nBelow is the documentation for Template-only and Glimmer components. If you\nare looking for the API documentation for Classic components, it is\n[available here](/ember/release/classes/Component). The source code for\nGlimmer components can be found in [`@glimmer/component`](https://github.com/glimmerjs/glimmer.js/tree/master/packages/%40glimmer/component).\n\n## Defining a Template-only Component\n\nThe simplest way to create a component is to create a template file in\n`app/templates/components`. For example, if you name a template\n`app/templates/components/person-profile.hbs`:\n\n```app/templates/components/person-profile.hbs\n<h1>{{@person.name}}</h1>\n<img src={{@person.avatar}}>\n<p class='signature'>{{@person.signature}}</p>\n```\n\nYou will be able to use `<PersonProfile />` to invoke this component elsewhere\nin your application:\n\n```app/templates/application.hbs\n<PersonProfile @person={{this.currentUser}} />\n```\n\nNote that component names are capitalized here in order to distinguish them\nfrom regular HTML elements, but they are dasherized in the file system.\n\nWhile the angle bracket invocation form is generally preferred, it is also\npossible to invoke the same component with the `{{person-profile}}` syntax:\n\n```app/templates/application.hbs\n{{person-profile person=this.currentUser}}\n```\n\nNote that with this syntax, you use dashes in the component name and\narguments are passed without the `@` sign.\n\nIn both cases, Ember will render the content of the component template we\ncreated above. The end result will be something like this:\n\n```html\n<h1>Tomster</h1>\n<img src=\"https://emberjs.com/tomster.jpg\">\n<p class='signature'>Out of office this week</p>\n```\n\n## File System Nesting\n\nComponents can be nested inside sub-folders for logical groupping. For\nexample, if we placed our template in\n`app/templates/components/person/short-profile.hbs`, we can invoke it as\n`<Person::ShortProfile />`:\n\n```app/templates/application.hbs\n<Person::ShortProfile @person={{this.currentUser}} />\n```\n\nOr equivalently, `{{person/short-profile}}`:\n\n```app/templates/application.hbs\n{{person/short-profile person=this.currentUser}}\n```\n\n## Using Blocks\n\nYou can use `yield` inside a template to include the **contents** of any block\nattached to the component. For instance, if we added a `{{yield}}` to our\ncomponent like so:\n\n```app/templates/components/person-profile.hbs\n<h1>{{@person.name}}</h1>\n{{yield}}\n```\n\nWe could then invoke it like this:\n\n```handlebars\n<PersonProfile @person={{this.currentUser}}>\n <p>Admin mode</p>\n</PersonProfile>\n```\n\nor with curly syntax like this:\n\n```handlebars\n{{#person-profile person=this.currentUser}}\n <p>Admin mode</p>\n{{/person-profile}}\n```\n\nAnd the content passed in between the brackets of the component would be\nrendered in the same place as the `{{yield}}` within it, replacing it.\n\nBlocks are executed in their original context, meaning they have access to the\nscope and any in-scope variables where they were defined.\n\n### Passing parameters to blocks\n\nYou can also pass positional parameters to `{{yield}}`, which are then made\navailable in the block:\n\n```app/templates/components/person-profile.hbs\n<h1>{{@person.name}}</h1>\n{{yield @person.signature}}\n```\n\nWe can then use this value in the block like so:\n\n```handlebars\n<PersonProfile @person={{this.currentUser}} as |signature|>\n {{signature}}\n</PersonProfile>\n```\n\n### Passing multiple blocks\n\nYou can pass multiple blocks to a component by giving them names, and\nspecifying which block you are yielding to with `{{yield}}`. For instance, if\nwe wanted to add a way for users to customize the title of our\n`<PersonProfile>` component, we could add a named block inside of the header:\n\n```app/templates/components/person-profile.hbs\n<h1>{{yield to=\"title\"}}</h1>\n{{yield}}\n```\n\nThis component could then be invoked like so:\n\n```handlebars\n<PersonProfile @person={{this.currentUser}}>\n <:title>{{this.currentUser.name}}</:title>\n <:default>{{this.currentUser.signature}}</:default>\n</PersonProfile>\n```\n\nWhen passing named blocks, you must name every block, including the `default`\nblock, which is the block that is defined if you do not pass a `to` parameter\nto `{{yield}}`. Whenever you invoke a component without passing explicitly\nnamed blocks, the passed block is considered the `default` block.\n\n### Passing parameters to named blocks\n\nYou can also pass parameters to named blocks:\n\n```app/templates/components/person-profile.hbs\n<h1>{{yield @person.name to=\"title\"}}</h1>\n{{yield @person.signature}}\n```\n\nThese parameters can then be used like so:\n\n```handlebars\n<PersonProfile @person={{this.currentUser}}>\n <:title as |name|>{{name}}</:title>\n <:default as |signature|>{{signature}}</:default>\n</PersonProfile>\n```\n\n### Checking to see if a block exists\n\nYou can also check to see if a block exists using the `(has-block)` keyword,\nand conditionally use it, or provide a default template instead.\n\n```app/templates/components/person-profile.hbs\n<h1>\n {{#if (has-block \"title\")}}\n {{yield @person.name to=\"title\"}}\n {{else}}\n {{@person.name}}\n {{/if}}\n</h1>\n\n{{#if (has-block)}}\n {{yield @person.signature}}\n{{else}}\n {{@person.signature}}\n{{/if}}\n```\n\nWith this template, we can then optionally pass in one block, both blocks, or\nnone at all:\n\n```handlebars\n{{! passing both blocks }}\n<PersonProfile @person={{this.currentUser}}>\n <:title as |name|>{{name}}</:title>\n <:default as |signature|>{{signature}}</:default>\n</PersonProfile>\n\n{{! passing just the title block }}\n<PersonProfile @person={{this.currentUser}}>\n <:title as |name|>{{name}}</:title>\n</PersonProfile>\n\n{{! passing just the default block }}\n<PersonProfile @person={{this.currentUser}} as |signature|>\n {{signature}}\n</PersonProfile>\n\n{{! not passing any blocks }}\n<PersonProfile @person={{this.currentUser}}/>\n```\n\n### Checking to see if a block has parameters\n\nWe can also check if a block receives parameters using the `(has-block-params)`\nkeyword, and conditionally yield different values if so.\n\n```app/templates/components/person-profile.hbs\n{{#if (has-block-params)}}\n {{yield @person.signature}}\n{{else}}\n {{yield}}\n{{/if}}\n```\n\n## Customizing Components With JavaScript\n\nTo add JavaScript to a component, create a JavaScript file in the same\nlocation as the template file, with the same name, and export a subclass\nof `Component` as the default value. For example, to add Javascript to the\n`PersonProfile` component which we defined above, we would create\n`app/components/person-profile.js` and export our class as the default, like\nso:\n\n```app/components/person-profile.js\nimport Component from '@glimmer/component';\n\nexport default class PersonProfileComponent extends Component {\n get displayName() {\n let { title, firstName, lastName } = this.args.person;\n\n if (title) {\n return `${title} ${lastName}`;\n } else {\n return `${firstName} ${lastName}`;\n }\n })\n}\n```\n\nYou can add your own properties, methods, and lifecycle hooks to this\nsubclass to customize its behavior, and you can reference the instance of the\nclass in your template using `{{this}}`. For instance, we could access the\n`displayName` property of our `PersonProfile` component instance in the\ntemplate like this:\n\n```app/templates/components/person-profile.hbs\n<h1>{{this.displayName}}</h1>\n{{yield}}\n```\n\n## `constructor`\n\nparams: `owner` object and `args` object\n\nConstructs a new component and assigns itself the passed properties. The\nconstructor is run whenever a new instance of the component is created, and\ncan be used to setup the initial state of the component.\n\n```javascript\nimport Component from '@glimmer/component';\n\nexport default class SomeComponent extends Component {\n constructor(owner, args) {\n super(owner, args);\n\n if (this.args.displayMode === 'list') {\n this.items = [];\n }\n }\n}\n```\n\nService injections and arguments are available in the constructor.\n\n```javascript\nimport Component from '@glimmer/component';\nimport { service } from '@ember/service';\n\nexport default class SomeComponent extends Component {\n @service myAnimations;\n\n constructor(owner, args) {\n super(owner, args);\n\n if (this.args.fadeIn === true) {\n this.myAnimations.register(this, 'fade-in');\n }\n }\n}\n```\n\n## `willDestroy`\n\n`willDestroy` is called after the component has been removed from the DOM, but\nbefore the component is fully destroyed. This lifecycle hook can be used to\ncleanup the component and any related state.\n\n```javascript\nimport Component from '@glimmer/component';\nimport { service } from '@ember/service';\n\nexport default class SomeComponent extends Component {\n @service myAnimations;\n\n willDestroy() {\n super.willDestroy();\n\n this.myAnimations.unregister(this);\n }\n}\n```\n\n## `args`\n\nThe `args` property of Glimmer components is an object that contains the\n_arguments_ that are passed to the component. For instance, the\nfollowing component usage:\n\n```handlebars\n<SomeComponent @fadeIn={{true}} />\n```\n\nWould result in the following `args` object to be passed to the component:\n\n```javascript\n{ fadeIn: true }\n```\n\n`args` can be accessed at any point in the component lifecycle, including\n`constructor` and `willDestroy`. They are also automatically marked as tracked\nproperties, and they can be depended on as computed property dependencies:\n\n```javascript\nimport Component from '@glimmer/component';\nimport { computed } from '@ember/object';\n\nexport default class SomeComponent extends Component {\n\n @computed('args.someValue')\n get computedGetter() {\n // updates whenever args.someValue updates\n return this.args.someValue;\n }\n\n get standardGetter() {\n // updates whenever args.anotherValue updates (Ember 3.13+)\n return this.args.anotherValue;\n }\n}\n```\n\n## `isDestroying`\n\nA boolean flag to tell if the component is in the process of destroying. This is set to\ntrue before `willDestroy` is called.\n\n## `isDestroyed`\nA boolean to tell if the component has been fully destroyed. This is set to true\nafter `willDestroy` is called.",
|
|
3358
|
+
"description": "A component is a reusable UI element that consists of a template and an\noptional JavaScript class that defines its behavior. For example, someone\nmight make a `button` in the template and handle the click behavior in the\nJavaScript.\n\nComponents are broken down into two categories:\n\n- Components _without_ JavaScript, that are based only on a template. These\n are called Template-only or TO components.\n- Components _with_ JavaScript, which consist of a template and a backing\n class.\n\nEmber ships with two types of JavaScript classes for components:\n\n1. Glimmer components, imported from `@glimmer/component`, which are the\n default components for Ember Octane (3.15) and more recent editions.\n2. Classic components, imported from `@ember/component`, which were the\n default for older editions of Ember (pre 3.15).\n\nBelow is the documentation for Template-only and Glimmer components. If you\nare looking for the API documentation for Classic components, it is\n[available here](/ember/release/classes/Component). The source code for\nGlimmer components can be found in [`@glimmer/component`](https://github.com/emberjs/ember.js/tree/main/packages/%40glimmer/component).\n\nNote: Prior to Ember 6.8, by default, components were authored in paired `.hbs` and `.js`\nfiles. This is still supported, but the default authoring format is now `.gjs` or \"template tag\".\nTo read more about how components were previously authored, see the\n[6.7 version of this API documentation](https://api.emberjs.com/ember/6.7/modules/@glimmer%2Fcomponent).\n \n## Defining a Template-only Component\n\nThe simplest way to create a component is to create a `gjs` file in\n`app/components` with a `<template>` tag wrapper:\n\n```app/components/person-profile.gjs\n<template>\n <h1>{{@person.name}}</h1>\n <img src={{@person.avatar}}>\n <p class='signature'>{{@person.signature}}</p>\n</template>\n```\n\nYou will be able to use `<PersonProfile />` to invoke this component elsewhere\nin your application:\n\n```app/templates/application.gjs\nimport PersonProfile from '../components/person-profile';\n \n<template>\n <PersonProfile @person={{@model.currentUser}} />\n</template>\n```\n\nNote that component names are capitalized here in order to distinguish them\nfrom regular HTML elements.\n\nEmber will render the content of the component template we\ncreated above. The end result will be something like this:\n\n```html\n<h1>Tomster</h1>\n<img src=\"https://emberjs.com/tomster.jpg\">\n<p class='signature'>Out of office this week</p>\n```\n\n## File System Nesting\n\nIn Ember templates, “invokables” are things you can invoke in a template. These include components,\nhelpers, and modifiers. In the template tag format, these invokables need to be imported before\nthey can be used. This makes it easier to understand where values come from and what they do, as\nwell as unlocks build optimizations.\n\nWhen making use of the `PersonProfile` component as defined before in a different component file,\nit first needs to be imported. This is done using the import statement, just like you would import\nany other JavaScript module -- from your local project or from an external package.\n\nSince they are imported, Components can be placed anywhere in your project on the filesystem, but\nthey are conventionally placed within `app/components` for reusable components and within\n`app/templates` for Route components.\n \nRoute components must be named after the route they are associated with -- and placed in the\n`app/templates` directory. For example, a `Person` route would have a corresponding `Person`\ncomponent defined in `app/templates/person.gjs`. This component would then be rendered whenever\nthe user visits the `/person` route. For more information, see the\n[Routing](https://guides.emberjs.com/release/routing/) section of the guides.\n\n## Using Blocks\n\nYou can use `yield` inside a template to include the **contents** of any block\nattached to the component. For instance, if we added a `{{yield}}` to our\ncomponent like so:\n\n```app/components/person-profile.gjs\n<template>\n <h1>{{@person.name}}</h1>\n {{yield}}\n</template>\n```\n\nWe could then invoke it like this:\n\n```gjs\nimport PersonProfile from '../components/person-profile';\n \n<template>\n <PersonProfile @person={{@model.currentUser}}>\n <p>Admin mode</p>\n </PersonProfile>\n</template>\n```\n \nAnd the content passed in between the brackets of the component would be\nrendered in the same place as the `{{yield}}` within it, replacing it.\n\nBlocks are executed in their original context, meaning they have access to the\nscope and any in-scope variables where they were defined.\n\n### Passing parameters to blocks\n\nYou can also pass positional parameters to `{{yield}}`, which are then made\navailable in the block:\n\n```app/components/person-profile.gjs\n<template>\n <h1>{{@person.name}}</h1>\n {{yield @person.signature}}\n</template>\n```\n\nWe can then use this value in the block like so:\n\n```gjs\nimport PersonProfile from '../components/person-profile';\n \n<template>\n <PersonProfile @person={{@model.currentUser}} as |signature|>\n {{signature}}\n </PersonProfile>\n</template>\n```\n\n### Passing multiple blocks\n\nYou can pass multiple blocks to a component by giving them names, and\nspecifying which block you are yielding to with `{{yield}}`. For instance, if\nwe wanted to add a way for users to customize the title of our\n`<PersonProfile>` component, we could add a named block inside of the header:\n\n```app/components/person-profile.gjs\n<template>\n <h1>{{yield to=\"title\"}}</h1>\n {{yield}}\n</template>\n```\n\nThis component could then be invoked like so:\n\n```gjs\nimport PersonProfile from '../components/person-profile';\n\n<template>\n <PersonProfile @person={{@model.currentUser}}>\n <:title>{{@model.currentUser.name}}</:title>\n <:default>{{@model.currentUser.signature}}</:default>\n </PersonProfile>\n</template>\n```\n\nWhen passing named blocks, you must name every block, including the `default`\nblock, which is the block that is defined if you do not pass a `to` parameter\nto `{{yield}}`. Whenever you invoke a component without passing explicitly\nnamed blocks, the passed block is considered the `default` block.\n\n### Passing parameters to named blocks\n\nYou can also pass parameters to named blocks:\n\n```app/components/person-profile.gjs\n<template>\n <h1>{{yield @person.name to=\"title\"}}</h1>\n {{yield @person.signature}}\n</template>\n```\n\nThese parameters can then be used like so:\n\n```gjs\nimport PersonProfile from '../components/person-profile';\n\n<template>\n <PersonProfile @person={{@model.currentUser}}>\n <:title as |name|>{{name}}</:title>\n <:default as |signature|>{{signature}}</:default>\n </PersonProfile>\n</template>\n```\n\n### Checking to see if a block exists\n\nYou can also check to see if a block exists using the `(has-block)` keyword,\nand conditionally use it, or provide a default template instead.\n\n```app/components/person-profile.gjs\n<template>\n <h1>\n {{#if (has-block \"title\")}}\n {{yield @person.name to=\"title\"}}\n {{else}}\n {{@person.name}}\n {{/if}}\n </h1>\n\n {{#if (has-block)}}\n {{yield @person.signature}}\n {{else}}\n {{@person.signature}}\n {{/if}}\n</template>\n```\n\nWith this template, we can then optionally pass in one block, both blocks, or\nnone at all:\n\n```gjs\nimport PersonProfile from '../components/person-profile';\n\n<template>\n {{! passing both blocks }}\n <PersonProfile @person={{@model.currentUser}}>\n <:title as |name|>{{name}}</:title>\n <:default as |signature|>{{signature}}</:default>\n </PersonProfile>\n\n {{! passing just the title block }}\n <PersonProfile @person={{@model.currentUser}}>\n <:title as |name|>{{name}}</:title>\n </PersonProfile>\n\n {{! passing just the default block }}\n <PersonProfile @person={{@model.currentUser}} as |signature|>\n {{signature}}\n </PersonProfile>\n\n {{! not passing any blocks }}\n <PersonProfile @person={{@model.currentUser}}/>\n</template>\n```\n\n### Checking to see if a block has parameters\n\nWe can also check if a block receives parameters using the `(has-block-params)`\nkeyword, and conditionally yield different values if so.\n\n```app/components/person-profile.gjs\n<template>\n {{#if (has-block-params)}}\n {{yield @person.signature}}\n {{else}}\n {{yield}}\n {{/if}}\n</template>\n```\n\n## Customizing Components With JavaScript\n\nTo add JavaScript to a component, add a class extending from `@glimmer/component` to the `gjs`\nfile, wrapping your `<template>` tag.\nFor example, to add JavaScript to the `PersonProfile` component which we defined above:\n\n```app/components/person-profile.gjs\nimport Component from '@glimmer/component';\n\nexport default class PersonProfile extends Component {\n get displayName() {\n let { title, firstName, lastName } = this.args.person;\n\n if (title) {\n return `${title} ${lastName}`;\n } else {\n return `${firstName} ${lastName}`;\n }\n })\n \n <template>\n <h1>{{this.displayName}}</h1>\n {{yield}}\n </template>\n}\n```\n\nYou can add your own properties, methods, and lifecycle hooks to this\nsubclass to customize its behavior, and you can reference the instance of the\nclass in your template using `{{this}}`. In the example above, we access the\n`displayName` property of our `PersonProfile` component instance in the\ntemplate.\n\n## `constructor`\n\nparams: `owner` object and `args` object\n\nConstructs a new component and assigns itself the passed properties. The\nconstructor is run whenever a new instance of the component is created, and\ncan be used to setup the initial state of the component.\n\n```gjs\nimport Component from '@glimmer/component';\n\nexport default class SomeComponent extends Component {\n constructor(owner, args) {\n super(owner, args);\n\n if (this.args.displayMode === 'list') {\n this.items = [];\n }\n }\n}\n```\n\nService injections and arguments are available in the constructor.\n\n```gjs\nimport Component from '@glimmer/component';\nimport { service } from '@ember/service';\n\nexport default class SomeComponent extends Component {\n @service myAnimations;\n\n constructor(owner, args) {\n super(owner, args);\n\n if (this.args.fadeIn === true) {\n this.myAnimations.register(this, 'fade-in');\n }\n }\n}\n```\n\n## `willDestroy`\n\n`willDestroy` is called after the component has been removed from the DOM, but\nbefore the component is fully destroyed. This lifecycle hook can be used to\ncleanup the component and any related state.\n \nYou may prefer the [@ember/destroyable](/ember/release/modules//@ember%2Fdestroyable) APIs for\nthis purpose.\n\n```gjs\nimport Component from '@glimmer/component';\nimport { service } from '@ember/service';\n\nexport default class SomeComponent extends Component {\n @service myAnimations;\n\n willDestroy() {\n super.willDestroy();\n\n this.myAnimations.unregister(this);\n }\n}\n```\n\n## `args`\n\nThe `args` property of Glimmer components is an object that contains the\n_arguments_ that are passed to the component. For instance, the\nfollowing component usage:\n\n```gjs\n<template>\n <SomeComponent @fadeIn={{true}} />\n</template>\n```\n\nWould result in the following `args` object to be passed to the component:\n\n```javascript\n{ fadeIn: true }\n```\n\n`args` can be accessed at any point in the component lifecycle, including\n`constructor` and `willDestroy`. They are also automatically marked as tracked\nproperties, and they can be depended on to update as any other tracked property:\n\n```gjs\nimport Component from '@glimmer/component';\nimport { computed } from '@ember/object';\n\nexport default class SomeComponent extends Component {\n get standardGetter() {\n // updates whenever args.anotherValue updates\n return this.args.anotherValue;\n }\n}\n```\n \nA components arguments are accessible in the template using the `@` prefix - for example,\n`this.args.fadeIn` from the example above can be accessed in the template as `@fadeIn`.\n\n## `isDestroying`\n\nA boolean flag to tell if the component is in the process of destroying. This is set to\ntrue before `willDestroy` is called.\n\n## `isDestroyed`\nA boolean to tell if the component has been fully destroyed. This is set to true\nafter `willDestroy` is called.",
|
|
3359
3359
|
"access": "public",
|
|
3360
3360
|
"tagname": ""
|
|
3361
3361
|
},
|
|
@@ -3493,7 +3493,7 @@
|
|
|
3493
3493
|
"module": "ember",
|
|
3494
3494
|
"namespace": "",
|
|
3495
3495
|
"file": "packages/@ember/-internals/glimmer/index.ts",
|
|
3496
|
-
"line":
|
|
3496
|
+
"line": 104,
|
|
3497
3497
|
"access": "public",
|
|
3498
3498
|
"tagname": ""
|
|
3499
3499
|
},
|
|
@@ -3614,7 +3614,7 @@
|
|
|
3614
3614
|
"namespace": "",
|
|
3615
3615
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
3616
3616
|
"line": 209,
|
|
3617
|
-
"description": "A component is a reusable UI element that consists of a `.hbs` template and an\noptional JavaScript class that defines its behavior. For example, someone\nmight make a `button` in the template and handle the click behavior in the\nJavaScript file that shares the same name as the template.\n\nComponents are broken down into two categories:\n\n- Components _without_ JavaScript, that are based only on a template. These\n are called Template-only or TO components.\n- Components _with_ JavaScript, which consist of a template and a backing\n class.\n\nEmber ships with two types of JavaScript classes for components:\n\n1. Glimmer components, imported from `@glimmer/component`, which are the\n default component's for Ember Octane (3.15) and more recent editions.\n2. Classic components, imported from `@ember/component`, which were the\n default for older editions of Ember (pre 3.15).\n\nBelow is the documentation for Classic components. If you are looking for the\nAPI documentation for Template-only or Glimmer components, it is [available\nhere](/ember/release/modules/@glimmer%2Fcomponent).\n\n## Defining a Classic Component\n\nIf you want to customize the component in order to handle events, transform\narguments or maintain internal state, you implement a subclass of `Component`.\n\nOne example is to add computed properties to your component:\n\n```app/components/person-profile.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n @computed('person.title', 'person.firstName', 'person.lastName')\n get displayName() {\n let { title, firstName, lastName } = this.person;\n\n if (title) {\n return `${title} ${lastName}`;\n } else {\n return `${firstName} ${lastName}`;\n }\n }\n}\n```\n\nAnd then use it in the component's template:\n\n```app/templates/components/person-profile.hbs\n<h1>{{this.displayName}}</h1>\n{{yield}}\n```\n\n## Customizing a Classic Component's HTML Element in JavaScript\n\n### HTML Tag\n\nThe default HTML tag name used for a component's HTML representation is `div`.\nThis can be customized by setting the `tagName` property.\n\nConsider the following component class:\n\n```app/components/emphasized-paragraph.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n tagName = 'em';\n}\n```\n\nWhen invoked, this component would produce output that looks something like\nthis:\n\n```html\n<em id=\"ember1\" class=\"ember-view\"></em>\n```\n\n### HTML `class` Attribute\n\nThe HTML `class` attribute of a component's tag can be set by providing a\n`classNames` property that is set to an array of strings:\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n classNames = ['my-class', 'my-other-class'];\n}\n```\n\nInvoking this component will produce output that looks like this:\n\n```html\n<div id=\"ember1\" class=\"ember-view my-class my-other-class\"></div>\n```\n\n`class` attribute values can also be set by providing a `classNameBindings`\nproperty set to an array of properties names for the component. The return\nvalue of these properties will be added as part of the value for the\ncomponents's `class` attribute. These properties can be computed properties:\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default class extends Component {\n classNames = ['my-class', 'my-other-class'];\n classNameBindings = ['propertyA', 'propertyB'];\n\n propertyA = 'from-a';\n\n get propertyB {\n if (someLogic) { return 'from-b'; }\n }\n}\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n<div id=\"ember1\" class=\"ember-view my-class my-other-class from-a from-b\"></div>\n```\n\nNote that `classNames` and `classNameBindings` is in addition to the `class`\nattribute passed with the angle bracket invocation syntax. Therefore, if this\ncomponent was invoked like so:\n\n```handlebars\n<MyWidget class=\"from-invocation\" />\n```\n\nThe resulting HTML will look similar to this:\n\n```html\n<div id=\"ember1\" class=\"from-invocation ember-view my-class my-other-class from-a from-b\"></div>\n```\n\nIf the value of a class name binding returns a boolean the property name\nitself will be used as the class name if the property is true. The class name\nwill not be added if the value is `false` or `undefined`.\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n classNameBindings = ['hovered'];\n\n hovered = true;\n}\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n<div id=\"ember1\" class=\"ember-view hovered\"></div>\n```\n\n### Custom Class Names for Boolean Values\n\nWhen using boolean class name bindings you can supply a string value other\nthan the property name for use as the `class` HTML attribute by appending the\npreferred value after a \":\" character when defining the binding:\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n classNameBindings = ['awesome:so-very-cool'];\n\n awesome = true;\n}\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n<div id=\"ember1\" class=\"ember-view so-very-cool\"></div>\n```\n\nBoolean value class name bindings whose property names are in a\ncamelCase-style format will be converted to a dasherized format:\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n classNameBindings = ['isUrgent'];\n\n isUrgent = true;\n}\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n<div id=\"ember1\" class=\"ember-view is-urgent\"></div>\n```\n\nClass name bindings can also refer to object values that are found by\ntraversing a path relative to the component itself:\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\nimport EmberObject from '@ember/object';\n\nexport default class extends Component {\n classNameBindings = ['messages.empty'];\n\n messages = EmberObject.create({\n empty: true\n });\n}\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n<div id=\"ember1\" class=\"ember-view empty\"></div>\n```\n\nIf you want to add a class name for a property which evaluates to true and and\na different class name if it evaluates to false, you can pass a binding like\nthis:\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n classNameBindings = ['isEnabled:enabled:disabled'];\n\n isEnabled = true;\n}\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n<div id=\"ember1\" class=\"ember-view enabled\"></div>\n```\n\nWhen isEnabled is `false`, the resulting HTML representation looks like this:\n\n```html\n<div id=\"ember1\" class=\"ember-view disabled\"></div>\n```\n\nThis syntax offers the convenience to add a class if a property is `false`:\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\n\n// Applies no class when isEnabled is true and class 'disabled' when isEnabled is false\nexport default class extends Component {\n classNameBindings = ['isEnabled::disabled'];\n\n isEnabled = true;\n}\n```\n\nInvoking this component when the `isEnabled` property is true will produce\nHTML that looks like:\n\n```html\n<div id=\"ember1\" class=\"ember-view\"></div>\n```\n\nInvoking it when the `isEnabled` property on the component is `false` will\nproduce HTML that looks like:\n\n```html\n<div id=\"ember1\" class=\"ember-view disabled\"></div>\n```\n\nUpdates to the value of a class name binding will result in automatic update\nof the HTML `class` attribute in the component's rendered HTML\nrepresentation. If the value becomes `false` or `undefined` the class name\nwill be removed.\n\nBoth `classNames` and `classNameBindings` are concatenated properties. See\n[EmberObject](/ember/release/classes/EmberObject) documentation for more\ninformation about concatenated properties.\n\n### Other HTML Attributes\n\nThe HTML attribute section of a component's tag can be set by providing an\n`attributeBindings` property set to an array of property names on the\ncomponent. The return value of these properties will be used as the value of\nthe component's HTML associated attribute:\n\n```app/components/my-anchor.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n tagName = 'a';\n attributeBindings = ['href'];\n\n href = 'http://google.com';\n};\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n<a id=\"ember1\" class=\"ember-view\" href=\"http://google.com\"></a>\n```\n\nOne property can be mapped on to another by placing a \":\" between the source\nproperty and the destination property:\n\n```app/components/my-anchor.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n tagName = 'a';\n attributeBindings = ['url:href'];\n\n url = 'http://google.com';\n};\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n<a id=\"ember1\" class=\"ember-view\" href=\"http://google.com\"></a>\n```\n\nHTML attributes passed with angle bracket invocations will take precedence\nover those specified in `attributeBindings`. Therefore, if this component was\ninvoked like so:\n\n```handlebars\n<MyAnchor href=\"http://bing.com\" @url=\"http://google.com\" />\n```\n\nThe resulting HTML will looks like this:\n\n```html\n<a id=\"ember1\" class=\"ember-view\" href=\"http://bing.com\"></a>\n```\n\nNote that the `href` attribute is ultimately set to `http://bing.com`, despite\nit having attribute binidng to the `url` property, which was set to\n`http://google.com`.\n\nNamespaced attributes (e.g. `xlink:href`) are supported, but have to be\nmapped, since `:` is not a valid character for properties in Javascript:\n\n```app/components/my-use.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n tagName = 'use';\n attributeBindings = ['xlinkHref:xlink:href'];\n\n xlinkHref = '#triangle';\n};\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n<use xlink:href=\"#triangle\"></use>\n```\n\nIf the value of a property monitored by `attributeBindings` is a boolean, the\nattribute will be present or absent depending on the value:\n\n```app/components/my-text-input.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n tagName = 'input';\n attributeBindings = ['disabled'];\n\n disabled = false;\n};\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n<input id=\"ember1\" class=\"ember-view\" />\n```\n\n`attributeBindings` can refer to computed properties:\n\n```app/components/my-text-input.js\nimport Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default class extends Component {\n tagName = 'input';\n attributeBindings = ['disabled'];\n\n get disabled() {\n if (someLogic) {\n return true;\n } else {\n return false;\n }\n }\n};\n```\n\nTo prevent setting an attribute altogether, use `null` or `undefined` as the\nvalue of the property used in `attributeBindings`:\n\n```app/components/my-text-input.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n tagName = 'form';\n attributeBindings = ['novalidate'];\n novalidate = null;\n};\n```\n\nUpdates to the property of an attribute binding will result in automatic\nupdate of the HTML attribute in the component's HTML output.\n\n`attributeBindings` is a concatenated property. See\n[EmberObject](/ember/release/classes/EmberObject) documentation for more\ninformation about concatenated properties.\n\n## Layouts\n\nThe `layout` property can be used to dynamically specify a template associated\nwith a component class, instead of relying on Ember to link together a\ncomponent class and a template based on file names.\n\nIn general, applications should not use this feature, but it's commonly used\nin addons for historical reasons.\n\nThe `layout` property should be set to the default export of a template\nmodule, which is the name of a template file without the `.hbs` extension.\n\n```app/templates/components/person-profile.hbs\n<h1>Person's Title</h1>\n<div class='details'>{{yield}}</div>\n```\n\n```app/components/person-profile.js\n import Component from '@ember/component';\n import layout from '../templates/components/person-profile';\n\n export default class extends Component {\n layout = layout;\n }\n```\n\nIf you invoke the component:\n\n```handlebars\n<PersonProfile>\n <h2>Chief Basket Weaver</h2>\n <h3>Fisherman Industries</h3>\n</PersonProfile>\n```\n\nor\n\n```handlebars\n{{#person-profile}}\n <h2>Chief Basket Weaver</h2>\n <h3>Fisherman Industries</h3>\n{{/person-profile}}\n```\n\nIt will result in the following HTML output:\n\n```html\n<h1>Person's Title</h1>\n <div class=\"details\">\n <h2>Chief Basket Weaver</h2>\n <h3>Fisherman Industries</h3>\n</div>\n```\n\n## Handling Browser Events\n\nThere are two ways to handle user-initiated events:\n\n### Using the `on` modifier to capture browser events\n\nIn a component's template, you can attach an event handler to any element with the `on` modifier:\n\n```handlebars\n<button {{on 'click' this.doSomething}} />\n```\n\nThis will call the function on your component:\n\n```js\nimport Component from '@ember/component';\n\nexport default class ExampleComponent extends Component {\n doSomething = (event) => {\n // `event` is the native click Event\n console.log('clicked on the button');\n };\n}\n```\n\nSee the [Guide on Component event\nhandlers](https://guides.emberjs.com/release/components/component-state-and-actions/#toc_html-modifiers-and-actions)\nand the [API docs for `on`](../Ember.Templates.helpers/methods/on?anchor=on)\nfor more details.\n\n### Event Handler Methods\n\nComponents can also respond to user-initiated events by implementing a method\nthat matches the event name. This approach is appropriate when the same event\nshould be handled by all instances of the same component.\n\nAn event object will be passed as the argument to the event handler method.\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n click(event) {\n // `event.target` is either the component's element or one of its children\n let tag = event.target.tagName.toLowerCase();\n console.log('clicked on a `<${tag}>` HTML element!');\n }\n}\n```\n\nIn this example, whenever the user clicked anywhere inside the component, it\nwill log a message to the console.\n\nIt is possible to handle event types other than `click` by implementing the\nfollowing event handler methods. In addition, custom events can be registered\nby using `Application.customEvents`.\n\nTouch events:\n\n* `touchStart`\n* `touchMove`\n* `touchEnd`\n* `touchCancel`\n\nKeyboard events:\n\n* `keyDown`\n* `keyUp`\n* `keyPress`\n\nMouse events:\n\n* `mouseDown`\n* `mouseUp`\n* `contextMenu`\n* `click`\n* `doubleClick`\n* `focusIn`\n* `focusOut`\n\nForm events:\n\n* `submit`\n* `change`\n* `focusIn`\n* `focusOut`\n* `input`\n\nDrag and drop events:\n\n* `dragStart`\n* `drag`\n* `dragEnter`\n* `dragLeave`\n* `dragOver`\n* `dragEnd`\n* `drop`",
|
|
3617
|
+
"description": "A component is a reusable UI element that consists of a `.hbs` template and an\noptional JavaScript class that defines its behavior. For example, someone\nmight make a `button` in the template and handle the click behavior in the\nJavaScript file that shares the same name as the template.\n\nComponents are broken down into two categories:\n\n- Components _without_ JavaScript, that are based only on a template. These\n are called Template-only or TO components.\n- Components _with_ JavaScript, which consist of a template and a backing\n class.\n\nEmber ships with two types of JavaScript classes for components:\n\n1. Glimmer components, imported from `@glimmer/component`, which are the\n default component's for Ember Octane (3.15) and more recent editions.\n2. Classic components, imported from `@ember/component`, which were the\n default for older editions of Ember (pre 3.15).\n\nBelow is the documentation for Classic components. If you are looking for the\nAPI documentation for Template-only or Glimmer components, it is [available\nhere](/ember/release/modules/@glimmer%2Fcomponent).\n\nNote: Prior to Ember 6.8, by default, components were authored in paired `.hbs` and `.js`\nfiles. This is still supported, but the default authoring format is now `.gjs` or \"template tag\".\nThe documentation for `@ember/component` still refers to the older authoring format. To read about\nthe new authoring format, see the \n[Glimmer Component API documentation](/ember/release/modules/@glimmer%2Fcomponent).\n \n## Defining a Classic Component\n\nIf you want to customize the component in order to handle events, transform\narguments or maintain internal state, you implement a subclass of `Component`.\n\nOne example is to add computed properties to your component:\n\n```app/components/person-profile.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n @computed('person.title', 'person.firstName', 'person.lastName')\n get displayName() {\n let { title, firstName, lastName } = this.person;\n\n if (title) {\n return `${title} ${lastName}`;\n } else {\n return `${firstName} ${lastName}`;\n }\n }\n}\n```\n\nAnd then use it in the component's template:\n\n```app/components/person-profile.hbs\n<h1>{{this.displayName}}</h1>\n{{yield}}\n```\n\n## Customizing a Classic Component's HTML Element in JavaScript\n\n### HTML Tag\n\nThe default HTML tag name used for a component's HTML representation is `div`.\nThis can be customized by setting the `tagName` property.\n\nConsider the following component class:\n\n```app/components/emphasized-paragraph.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n tagName = 'em';\n}\n```\n\nWhen invoked, this component would produce output that looks something like\nthis:\n\n```html\n<em id=\"ember1\" class=\"ember-view\"></em>\n```\n\n### HTML `class` Attribute\n\nThe HTML `class` attribute of a component's tag can be set by providing a\n`classNames` property that is set to an array of strings:\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n classNames = ['my-class', 'my-other-class'];\n}\n```\n\nInvoking this component will produce output that looks like this:\n\n```html\n<div id=\"ember1\" class=\"ember-view my-class my-other-class\"></div>\n```\n\n`class` attribute values can also be set by providing a `classNameBindings`\nproperty set to an array of properties names for the component. The return\nvalue of these properties will be added as part of the value for the\ncomponents's `class` attribute. These properties can be computed properties:\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default class extends Component {\n classNames = ['my-class', 'my-other-class'];\n classNameBindings = ['propertyA', 'propertyB'];\n\n propertyA = 'from-a';\n\n get propertyB {\n if (someLogic) { return 'from-b'; }\n }\n}\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n<div id=\"ember1\" class=\"ember-view my-class my-other-class from-a from-b\"></div>\n```\n\nNote that `classNames` and `classNameBindings` is in addition to the `class`\nattribute passed with the angle bracket invocation syntax. Therefore, if this\ncomponent was invoked like so:\n\n```handlebars\n<MyWidget class=\"from-invocation\" />\n```\n\nThe resulting HTML will look similar to this:\n\n```html\n<div id=\"ember1\" class=\"from-invocation ember-view my-class my-other-class from-a from-b\"></div>\n```\n\nIf the value of a class name binding returns a boolean the property name\nitself will be used as the class name if the property is true. The class name\nwill not be added if the value is `false` or `undefined`.\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n classNameBindings = ['hovered'];\n\n hovered = true;\n}\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n<div id=\"ember1\" class=\"ember-view hovered\"></div>\n```\n\n### Custom Class Names for Boolean Values\n\nWhen using boolean class name bindings you can supply a string value other\nthan the property name for use as the `class` HTML attribute by appending the\npreferred value after a \":\" character when defining the binding:\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n classNameBindings = ['awesome:so-very-cool'];\n\n awesome = true;\n}\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n<div id=\"ember1\" class=\"ember-view so-very-cool\"></div>\n```\n\nBoolean value class name bindings whose property names are in a\ncamelCase-style format will be converted to a dasherized format:\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n classNameBindings = ['isUrgent'];\n\n isUrgent = true;\n}\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n<div id=\"ember1\" class=\"ember-view is-urgent\"></div>\n```\n\nClass name bindings can also refer to object values that are found by\ntraversing a path relative to the component itself:\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\nimport EmberObject from '@ember/object';\n\nexport default class extends Component {\n classNameBindings = ['messages.empty'];\n\n messages = EmberObject.create({\n empty: true\n });\n}\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n<div id=\"ember1\" class=\"ember-view empty\"></div>\n```\n\nIf you want to add a class name for a property which evaluates to true and and\na different class name if it evaluates to false, you can pass a binding like\nthis:\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n classNameBindings = ['isEnabled:enabled:disabled'];\n\n isEnabled = true;\n}\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n<div id=\"ember1\" class=\"ember-view enabled\"></div>\n```\n\nWhen isEnabled is `false`, the resulting HTML representation looks like this:\n\n```html\n<div id=\"ember1\" class=\"ember-view disabled\"></div>\n```\n\nThis syntax offers the convenience to add a class if a property is `false`:\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\n\n// Applies no class when isEnabled is true and class 'disabled' when isEnabled is false\nexport default class extends Component {\n classNameBindings = ['isEnabled::disabled'];\n\n isEnabled = true;\n}\n```\n\nInvoking this component when the `isEnabled` property is true will produce\nHTML that looks like:\n\n```html\n<div id=\"ember1\" class=\"ember-view\"></div>\n```\n\nInvoking it when the `isEnabled` property on the component is `false` will\nproduce HTML that looks like:\n\n```html\n<div id=\"ember1\" class=\"ember-view disabled\"></div>\n```\n\nUpdates to the value of a class name binding will result in automatic update\nof the HTML `class` attribute in the component's rendered HTML\nrepresentation. If the value becomes `false` or `undefined` the class name\nwill be removed.\n\nBoth `classNames` and `classNameBindings` are concatenated properties. See\n[EmberObject](/ember/release/classes/EmberObject) documentation for more\ninformation about concatenated properties.\n\n### Other HTML Attributes\n\nThe HTML attribute section of a component's tag can be set by providing an\n`attributeBindings` property set to an array of property names on the\ncomponent. The return value of these properties will be used as the value of\nthe component's HTML associated attribute:\n\n```app/components/my-anchor.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n tagName = 'a';\n attributeBindings = ['href'];\n\n href = 'http://google.com';\n};\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n<a id=\"ember1\" class=\"ember-view\" href=\"http://google.com\"></a>\n```\n\nOne property can be mapped on to another by placing a \":\" between the source\nproperty and the destination property:\n\n```app/components/my-anchor.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n tagName = 'a';\n attributeBindings = ['url:href'];\n\n url = 'http://google.com';\n};\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n<a id=\"ember1\" class=\"ember-view\" href=\"http://google.com\"></a>\n```\n\nHTML attributes passed with angle bracket invocations will take precedence\nover those specified in `attributeBindings`. Therefore, if this component was\ninvoked like so:\n\n```handlebars\n<MyAnchor href=\"http://bing.com\" @url=\"http://google.com\" />\n```\n\nThe resulting HTML will looks like this:\n\n```html\n<a id=\"ember1\" class=\"ember-view\" href=\"http://bing.com\"></a>\n```\n\nNote that the `href` attribute is ultimately set to `http://bing.com`, despite\nit having attribute binidng to the `url` property, which was set to\n`http://google.com`.\n\nNamespaced attributes (e.g. `xlink:href`) are supported, but have to be\nmapped, since `:` is not a valid character for properties in Javascript:\n\n```app/components/my-use.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n tagName = 'use';\n attributeBindings = ['xlinkHref:xlink:href'];\n\n xlinkHref = '#triangle';\n};\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n<use xlink:href=\"#triangle\"></use>\n```\n\nIf the value of a property monitored by `attributeBindings` is a boolean, the\nattribute will be present or absent depending on the value:\n\n```app/components/my-text-input.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n tagName = 'input';\n attributeBindings = ['disabled'];\n\n disabled = false;\n};\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n<input id=\"ember1\" class=\"ember-view\" />\n```\n\n`attributeBindings` can refer to computed properties:\n\n```app/components/my-text-input.js\nimport Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default class extends Component {\n tagName = 'input';\n attributeBindings = ['disabled'];\n\n get disabled() {\n if (someLogic) {\n return true;\n } else {\n return false;\n }\n }\n};\n```\n\nTo prevent setting an attribute altogether, use `null` or `undefined` as the\nvalue of the property used in `attributeBindings`:\n\n```app/components/my-text-input.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n tagName = 'form';\n attributeBindings = ['novalidate'];\n novalidate = null;\n};\n```\n\nUpdates to the property of an attribute binding will result in automatic\nupdate of the HTML attribute in the component's HTML output.\n\n`attributeBindings` is a concatenated property. See\n[EmberObject](/ember/release/classes/EmberObject) documentation for more\ninformation about concatenated properties.\n\n## Layouts\n\nThe `layout` property can be used to dynamically specify a template associated\nwith a component class, instead of relying on Ember to link together a\ncomponent class and a template based on file names.\n\nIn general, applications should not use this feature, but it's commonly used\nin addons for historical reasons.\n\nThe `layout` property should be set to the default export of a template\nmodule, which is the name of a template file without the `.hbs` extension.\n\n```app/components/person-profile.hbs\n<h1>Person's Title</h1>\n<div class='details'>{{yield}}</div>\n```\n\n```app/components/person-profile.js\n import Component from '@ember/component';\n import layout from '../templates/components/person-profile';\n\n export default class extends Component {\n layout = layout;\n }\n```\n\nIf you invoke the component:\n\n```handlebars\n<PersonProfile>\n <h2>Chief Basket Weaver</h2>\n <h3>Fisherman Industries</h3>\n</PersonProfile>\n```\n\nor\n\n```handlebars\n{{#person-profile}}\n <h2>Chief Basket Weaver</h2>\n <h3>Fisherman Industries</h3>\n{{/person-profile}}\n```\n\nIt will result in the following HTML output:\n\n```html\n<h1>Person's Title</h1>\n <div class=\"details\">\n <h2>Chief Basket Weaver</h2>\n <h3>Fisherman Industries</h3>\n</div>\n```\n\n## Handling Browser Events\n\nThere are two ways to handle user-initiated events:\n\n### Using the `on` modifier to capture browser events\n\nIn a component's template, you can attach an event handler to any element with the `on` modifier:\n\n```handlebars\n<button {{on 'click' this.doSomething}} />\n```\n\nThis will call the function on your component:\n\n```js\nimport Component from '@ember/component';\n\nexport default class ExampleComponent extends Component {\n doSomething = (event) => {\n // `event` is the native click Event\n console.log('clicked on the button');\n };\n}\n```\n\nSee the [Guide on Component event\nhandlers](https://guides.emberjs.com/release/components/component-state-and-actions/#toc_html-modifiers-and-actions)\nand the [API docs for `on`](../Ember.Templates.helpers/methods/on?anchor=on)\nfor more details.\n\n### Event Handler Methods\n\nComponents can also respond to user-initiated events by implementing a method\nthat matches the event name. This approach is appropriate when the same event\nshould be handled by all instances of the same component.\n\nAn event object will be passed as the argument to the event handler method.\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\n\nexport default class extends Component {\n click(event) {\n // `event.target` is either the component's element or one of its children\n let tag = event.target.tagName.toLowerCase();\n console.log('clicked on a `<${tag}>` HTML element!');\n }\n}\n```\n\nIn this example, whenever the user clicked anywhere inside the component, it\nwill log a message to the console.\n\nIt is possible to handle event types other than `click` by implementing the\nfollowing event handler methods. In addition, custom events can be registered\nby using `Application.customEvents`.\n\nTouch events:\n\n* `touchStart`\n* `touchMove`\n* `touchEnd`\n* `touchCancel`\n\nKeyboard events:\n\n* `keyDown`\n* `keyUp`\n* `keyPress`\n\nMouse events:\n\n* `mouseDown`\n* `mouseUp`\n* `contextMenu`\n* `click`\n* `doubleClick`\n* `focusIn`\n* `focusOut`\n\nForm events:\n\n* `submit`\n* `change`\n* `focusIn`\n* `focusOut`\n* `input`\n\nDrag and drop events:\n\n* `dragStart`\n* `drag`\n* `dragEnter`\n* `dragLeave`\n* `dragOver`\n* `dragEnd`\n* `drop`",
|
|
3618
3618
|
"extends": "Ember.CoreView",
|
|
3619
3619
|
"uses": [
|
|
3620
3620
|
"Ember.TargetActionSupport",
|
|
@@ -3646,7 +3646,7 @@
|
|
|
3646
3646
|
"namespace": "",
|
|
3647
3647
|
"file": "packages/@ember/-internals/glimmer/lib/helper.ts",
|
|
3648
3648
|
"line": 57,
|
|
3649
|
-
"description": "Ember Helpers are functions that can compute values, and are used in templates.\nFor example, this code calls a helper named `format-currency`:\n\n```app/templates/application.
|
|
3649
|
+
"description": "Ember Helpers are functions that can compute values, and are used in templates.\nFor example, this code calls a helper named `format-currency`:\n\n```app/templates/application.gjs\nimport Cost from '../components/cost';\n \n<template>\n <Cost @cents={{230}} />\n</template>\n```\n\n```app/components/cost.gjs\nimport formatCurrency from '../helpers/format-currency';\n \n<template>\n <div>{{formatCurrency @cents currency=\"$\"}}</div>\n</template>\n```\n\nAdditionally a helper can be called as a nested helper.\nIn this example, we show the formatted currency value if the `showMoney`\nnamed argument is truthy.\n\n```gjs\nimport formatCurrency from '../helpers/format-currency';\n\n<template>\n {{if @showMoney (formatCurrency @cents currency=\"$\")}}\n</template>\n```\n\nHelpers defined using a class must provide a `compute` function. For example:\n\n```app/helpers/format-currency.js\nimport Helper from '@ember/component/helper';\n\nexport default class extends Helper {\n compute([cents], { currency }) {\n return `${currency}${cents * 0.01}`;\n }\n}\n```\n\nEach time the input to a helper changes, the `compute` function will be\ncalled again.\n\nAs instances, these helpers also have access to the container and will accept\ninjected dependencies.\n\nAdditionally, class helpers can call `recompute` to force a new computation.",
|
|
3650
3650
|
"extends": "CoreObject",
|
|
3651
3651
|
"access": "public",
|
|
3652
3652
|
"tagname": "",
|
|
@@ -4147,7 +4147,7 @@
|
|
|
4147
4147
|
"namespace": "Ember",
|
|
4148
4148
|
"file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts",
|
|
4149
4149
|
"line": 12,
|
|
4150
|
-
"description": "`TargetActionSupport` is a mixin that can be included in a class\nto add a `triggerAction` method with semantics similar to the
|
|
4150
|
+
"description": "`TargetActionSupport` is a mixin that can be included in a class\nto add a `triggerAction` method with semantics similar to the\n`{{action}}` helper. In normal Ember usage, the `{{action}}` helper is\nusually the best choice. This mixin is most often useful when you are\ndoing more complex event handling in Components.",
|
|
4151
4151
|
"extends": "Mixin",
|
|
4152
4152
|
"access": "private",
|
|
4153
4153
|
"tagname": ""
|
|
@@ -4370,7 +4370,7 @@
|
|
|
4370
4370
|
"module": "ember",
|
|
4371
4371
|
"namespace": "",
|
|
4372
4372
|
"file": "packages/@ember/array/index.ts",
|
|
4373
|
-
"line":
|
|
4373
|
+
"line": 2075,
|
|
4374
4374
|
"description": "The NativeArray mixin contains the properties needed to make the native\nArray support MutableArray and all of its dependent APIs.",
|
|
4375
4375
|
"uses": [
|
|
4376
4376
|
"MutableArray",
|
|
@@ -4995,7 +4995,7 @@
|
|
|
4995
4995
|
"namespace": "",
|
|
4996
4996
|
"file": "packages/@ember/routing/router-service.ts",
|
|
4997
4997
|
"line": 28,
|
|
4998
|
-
"description": "The Router service is the public API that provides access to the router.\n\nThe immediate benefit of the Router service is that you can inject it into components,\ngiving them a friendly way to initiate transitions and ask questions about the current\nglobal router state.\n\nIn this example, the Router service is injected into a component to initiate a transition\nto a dedicated route:\n\n```app/components/example.
|
|
4998
|
+
"description": "The Router service is the public API that provides access to the router.\n\nThe immediate benefit of the Router service is that you can inject it into components,\ngiving them a friendly way to initiate transitions and ask questions about the current\nglobal router state.\n\nIn this example, the Router service is injected into a component to initiate a transition\nto a dedicated route:\n\n```app/components/example.gjs\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { service } from '@ember/service';\n\nexport default class ExampleComponent extends Component {\n @service router;\n\n @action\n next() {\n this.router.transitionTo('other.route');\n }\n}\n```\n\nLike any service, it can also be injected into helpers, routes, etc.",
|
|
4999
4999
|
"access": "public",
|
|
5000
5000
|
"tagname": "",
|
|
5001
5001
|
"extends": "Service"
|
|
@@ -6504,7 +6504,7 @@
|
|
|
6504
6504
|
{
|
|
6505
6505
|
"file": "packages/@ember/-internals/glimmer/lib/components/input.ts",
|
|
6506
6506
|
"line": 67,
|
|
6507
|
-
"description": "The `Input` component lets you create an HTML `<input>` element.\n\n```
|
|
6507
|
+
"description": "The `Input` component lets you create an HTML `<input>` element.\n\n```gjs\nimport { Input } from '@ember/component';\n \n<template>\n <Input @value=\"987\" />\n</template>\n```\n\ncreates an `<input>` element with `type=\"text\"` and value set to 987.\n\n### Text field\n\nIf no `type` argument is specified, a default of type 'text' is used.\n\n```handlebars\nSearch:\n<Input @value={{this.searchWord}} />\n```\n\nIn this example, the initial value in the `<input>` will be set to the value of\n`this.searchWord`. If the user changes the text, the value of `this.searchWord` will also be\nupdated.\n\n### Actions\n\nThe `Input` component takes a number of arguments with callbacks that are invoked in response to\nuser events.\n\n* `enter`\n* `insert-newline`\n* `escape-press`\n* `focus-in`\n* `focus-out`\n* `key-down`\n* `key-press`\n* `key-up`\n\nThese callbacks are passed to `Input` like this:\n\n```handlebars\n<Input @value={{this.searchWord}} @enter={{this.query}} />\n```\n\nStarting with Ember Octane, we recommend using the `{{on}}` modifier to call actions\non specific events, such as the input event.\n\n```handlebars\n<label for=\"input-name\">Name:</label>\n<Input\n @id=\"input-name\"\n @value={{this.name}}\n {{on \"input\" this.validateName}}\n/>\n```\n\nThe event name (e.g. `focusout`, `input`, `keydown`) always follows the casing\nthat the HTML standard uses.\n\n### `<input>` HTML Attributes to Avoid\n\nIn most cases, if you want to pass an attribute to the underlying HTML `<input>` element, you\ncan pass the attribute directly, just like any other Ember component.\n\n```handlebars\n<Input @type=\"text\" size=\"10\" />\n```\n\nIn this example, the `size` attribute will be applied to the underlying `<input>` element in the\noutputted HTML.\n\nHowever, there are a few attributes where you **must** use the `@` version.\n\n* `@type`: This argument is used to control which Ember component is used under the hood\n* `@value`: The `@value` argument installs a two-way binding onto the element. If you wanted a\n one-way binding, use `<input>` with the `value` property and the `input` event instead.\n* `@checked` (for checkboxes): like `@value`, the `@checked` argument installs a two-way binding\n onto the element. If you wanted a one-way binding, use `<input type=\"checkbox\">` with\n `checked` and the `input` event instead.\n\n### Checkbox\n\nTo create an `<input type=\"checkbox\">`:\n\n```handlebars\nEmberize Everything:\n<Input @type=\"checkbox\" @checked={{this.isEmberized}} name=\"isEmberized\" />\n```\n\nThis will bind the checked state of this checkbox to the value of `isEmberized` -- if either one\nchanges, it will be reflected in the other.",
|
|
6508
6508
|
"itemtype": "method",
|
|
6509
6509
|
"name": "Input",
|
|
6510
6510
|
"params": [
|
|
@@ -6521,14 +6521,14 @@
|
|
|
6521
6521
|
},
|
|
6522
6522
|
{
|
|
6523
6523
|
"file": "packages/@ember/-internals/glimmer/lib/components/input.ts",
|
|
6524
|
-
"line":
|
|
6524
|
+
"line": 171,
|
|
6525
6525
|
"description": "The HTML class attribute.",
|
|
6526
6526
|
"class": "Ember.Templates.components",
|
|
6527
6527
|
"module": "@ember/component"
|
|
6528
6528
|
},
|
|
6529
6529
|
{
|
|
6530
6530
|
"file": "packages/@ember/-internals/glimmer/lib/components/input.ts",
|
|
6531
|
-
"line":
|
|
6531
|
+
"line": 182,
|
|
6532
6532
|
"description": "The HTML type attribute.",
|
|
6533
6533
|
"class": "Ember.Templates.components",
|
|
6534
6534
|
"module": "@ember/component"
|
|
@@ -6550,7 +6550,7 @@
|
|
|
6550
6550
|
{
|
|
6551
6551
|
"file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts",
|
|
6552
6552
|
"line": 48,
|
|
6553
|
-
"description": "The `LinkTo` component renders a link to the supplied `routeName` passing an optionally\nsupplied model to the route as its `model` context of the route. The block for `LinkTo`\nbecomes the contents of the rendered element:\n\n```
|
|
6553
|
+
"description": "The `LinkTo` component renders a link to the supplied `routeName` passing an optionally\nsupplied model to the route as its `model` context of the route. The block for `LinkTo`\nbecomes the contents of the rendered element:\n\n```gjs\nimport { LinkTo } from '@ember/routing';\n \n<template>\n <LinkTo @route='photoGallery'>\n Great Hamster Photos\n </LinkTo>\n</template>\n```\n\nThis will result in:\n\n```html\n<a href=\"/hamster-photos\">\n Great Hamster Photos\n</a>\n```\n\n### Disabling the `LinkTo` component\n\nThe `LinkTo` component can be disabled by using the `disabled` argument. A disabled link\ndoesn't result in a transition when activated, and adds the `disabled` class to the `<a>`\nelement.\n\n(The class name to apply to the element can be overridden by using the `disabledClass`\nargument)\n\n```handlebars\n<LinkTo @route='photoGallery' @disabled={{true}}>\n Great Hamster Photos\n</LinkTo>\n```\n\n### Handling `href`\n\n`<LinkTo>` will use your application's Router to fill the element's `href` property with a URL\nthat matches the path to the supplied `routeName`.\n\n### Handling current route\n\nThe `LinkTo` component will apply a CSS class name of 'active' when the application's current\nroute matches the supplied routeName. For example, if the application's current route is\n'photoGallery.recent', then the following invocation of `LinkTo`:\n\n```handlebars\n<LinkTo @route='photoGallery.recent'>\n Great Hamster Photos\n</LinkTo>\n```\n\nwill result in\n\n```html\n<a href=\"/hamster-photos/this-week\" class=\"active\">\n Great Hamster Photos\n</a>\n```\n\nThe CSS class used for active classes can be customized by passing an `activeClass` argument:\n\n```handlebars\n<LinkTo @route='photoGallery.recent' @activeClass=\"current-url\">\n Great Hamster Photos\n</LinkTo>\n```\n\n```html\n<a href=\"/hamster-photos/this-week\" class=\"current-url\">\n Great Hamster Photos\n</a>\n```\n\n### Keeping a link active for other routes\n\nIf you need a link to be 'active' even when it doesn't match the current route, you can use the\n`current-when` argument.\n\n```handlebars\n<LinkTo @route='photoGallery' @current-when='photos'>\n Photo Gallery\n</LinkTo>\n```\n\nThis may be helpful for keeping links active for:\n\n* non-nested routes that are logically related\n* some secondary menu approaches\n* 'top navigation' with 'sub navigation' scenarios\n\nA link will be active if `current-when` is `true` or the current\nroute is the route this link would transition to.\n\nTo match multiple routes 'space-separate' the routes:\n\n```handlebars\n<LinkTo @route='gallery' @current-when='photos drawings paintings'>\n Art Gallery\n</LinkTo>\n```\n\n### Supplying a model\n\nAn optional `model` argument can be used for routes whose\npaths contain dynamic segments. This argument will become\nthe model context of the linked route:\n\n```javascript\nRouter.map(function() {\n this.route(\"photoGallery\", {path: \"hamster-photos/:photo_id\"});\n});\n```\n\n```handlebars\n<LinkTo @route='photoGallery' @model={{this.aPhoto}}>\n {{aPhoto.title}}\n</LinkTo>\n```\n\n```html\n<a href=\"/hamster-photos/42\">\n Tomster\n</a>\n```\n\n### Supplying multiple models\n\nFor deep-linking to route paths that contain multiple\ndynamic segments, the `models` argument can be used.\n\nAs the router transitions through the route path, each\nsupplied model argument will become the context for the\nroute with the dynamic segments:\n\n```javascript\nRouter.map(function() {\n this.route(\"photoGallery\", { path: \"hamster-photos/:photo_id\" }, function() {\n this.route(\"comment\", {path: \"comments/:comment_id\"});\n });\n});\n```\n\nThis argument will become the model context of the linked route:\n\n```handlebars\n<LinkTo @route='photoGallery.comment' @models={{array this.aPhoto this.comment}}>\n {{comment.body}}\n</LinkTo>\n```\n\n```html\n<a href=\"/hamster-photos/42/comments/718\">\n A+++ would snuggle again.\n</a>\n```\n\n### Supplying an explicit dynamic segment value\n\nIf you don't have a model object available to pass to `LinkTo`,\nan optional string or integer argument can be passed for routes whose\npaths contain dynamic segments. This argument will become the value\nof the dynamic segment:\n\n```javascript\nRouter.map(function() {\n this.route(\"photoGallery\", { path: \"hamster-photos/:photo_id\" });\n});\n```\n\n```handlebars\n<LinkTo @route='photoGallery' @model={{aPhotoId}}>\n {{this.aPhoto.title}}\n</LinkTo>\n```\n\n```html\n<a href=\"/hamster-photos/42\">\n Tomster\n</a>\n```\n\nWhen transitioning into the linked route, the `model` hook will\nbe triggered with parameters including this passed identifier.\n\n### Supplying query parameters\n\nIf you need to add optional key-value pairs that appear to the right of the ? in a URL,\nyou can use the `query` argument.\n\n```handlebars\n<LinkTo @route='photoGallery' @query={{hash page=1 per_page=20}}>\n Great Hamster Photos\n</LinkTo>\n```\n\nThis will result in:\n\n```html\n<a href=\"/hamster-photos?page=1&per_page=20\">\n Great Hamster Photos\n</a>\n```",
|
|
6554
6554
|
"itemtype": "method",
|
|
6555
6555
|
"name": "LinkTo",
|
|
6556
6556
|
"access": "public",
|
|
@@ -6560,7 +6560,7 @@
|
|
|
6560
6560
|
},
|
|
6561
6561
|
{
|
|
6562
6562
|
"file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts",
|
|
6563
|
-
"line":
|
|
6563
|
+
"line": 264,
|
|
6564
6564
|
"description": "See [Ember.Templates.components.LinkTo](/ember/release/classes/Ember.Templates.components/methods/input?anchor=LinkTo).",
|
|
6565
6565
|
"itemtype": "method",
|
|
6566
6566
|
"name": "link-to",
|
|
@@ -6574,7 +6574,7 @@
|
|
|
6574
6574
|
},
|
|
6575
6575
|
{
|
|
6576
6576
|
"file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts",
|
|
6577
|
-
"line":
|
|
6577
|
+
"line": 273,
|
|
6578
6578
|
"description": "An opaque interface which can be imported and used in strict-mode\ntemplates to call <LinkTo>.\n\nSee [Ember.Templates.components.LinkTo](/ember/release/classes/Ember.Templates.components/methods/input?anchor=LinkTo).",
|
|
6579
6579
|
"itemtype": "method",
|
|
6580
6580
|
"name": "LinkTo",
|
|
@@ -6589,7 +6589,7 @@
|
|
|
6589
6589
|
{
|
|
6590
6590
|
"file": "packages/@ember/-internals/glimmer/lib/components/textarea.ts",
|
|
6591
6591
|
"line": 10,
|
|
6592
|
-
"description": "The `Textarea` component inserts a new instance of `<textarea>` tag into the template.\n\nThe `@value` argument provides the content of the `<textarea>`.\n\nThis template:\n\n```handlebars\n<Textarea @value=\"A bunch of text\" />\n```\n\nWould result in the following HTML:\n\n```html\n<textarea class=\"ember-text-area\">\n A bunch of text\n</textarea>\n```\n\nThe `@value` argument is two-way bound. If the user types text into the textarea, the `@value`\nargument is updated. If the `@value` argument is updated, the text in the textarea is updated.\n\nIn the following example, the `writtenWords` property on the component will be updated as the user\ntypes 'Lots of text' into the text area of their browser's window.\n\n```app/components/word-editor.
|
|
6592
|
+
"description": "The `Textarea` component inserts a new instance of `<textarea>` tag into the template.\n\nThe `@value` argument provides the content of the `<textarea>`.\n\nThis template:\n\n```handlebars\nimport { Textarea } from '@ember/component';\n\n<template>\n <Textarea @value=\"A bunch of text\" />\n</template>\n```\n\nWould result in the following HTML:\n\n```html\n<textarea class=\"ember-text-area\">\n A bunch of text\n</textarea>\n```\n\nThe `@value` argument is two-way bound. If the user types text into the textarea, the `@value`\nargument is updated. If the `@value` argument is updated, the text in the textarea is updated.\n\nIn the following example, the `writtenWords` property on the component will be updated as the user\ntypes 'Lots of text' into the text area of their browser's window.\n\n```app/components/word-editor.gjs\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class WordEditorComponent extends Component {\n @tracked writtenWords = \"Lots of text that IS bound\";\n \n <template>\n <Textarea @value={{writtenWords}} />\n </template>\n}\n```\n\nWould result in the following HTML:\n\n```html\n<textarea class=\"ember-text-area\">\n Lots of text that IS bound\n</textarea>\n```\n\nIf you wanted a one way binding, you could use the `<textarea>` element directly, and use the\n`value` DOM property and the `input` event.\n\n### Actions\n\nThe `Textarea` component takes a number of arguments with callbacks that are invoked in\nresponse to user events.\n\n* `enter`\n* `insert-newline`\n* `escape-press`\n* `focus-in`\n* `focus-out`\n* `key-press`\n\nThese callbacks are passed to `Textarea` like this:\n\n```handlebars\n<Textarea @value={{this.searchWord}} @enter={{this.query}} />\n```\n\n## Classic Invocation Syntax\n\nThe `Textarea` component can also be invoked using curly braces, just like any other Ember\ncomponent.\n\nFor example, this is an invocation using angle-bracket notation:\n\n```handlebars\n<Textarea @value={{this.searchWord}} @enter={{this.query}} />\n```\n\nYou could accomplish the same thing using classic invocation:\n\n```handlebars\n{{textarea value=this.searchWord enter=this.query}}\n```\n\nThe main difference is that angle-bracket invocation supports any HTML attribute using HTML\nattribute syntax, because attributes and arguments have different syntax when using angle-bracket\ninvocation. Curly brace invocation, on the other hand, only has a single syntax for arguments,\nand components must manually map attributes onto component arguments.\n\nWhen using classic invocation with `{{textarea}}`, only the following attributes are mapped onto\narguments:\n\n* rows\n* cols\n* name\n* selectionEnd\n* selectionStart\n* autocomplete\n* wrap\n* lang\n* dir\n* value\n\n## Classic `layout` and `layoutName` properties\n\nBecause HTML `textarea` elements do not contain inner HTML the `layout` and\n`layoutName` properties will not be applied.",
|
|
6593
6593
|
"itemtype": "method",
|
|
6594
6594
|
"name": "Textarea",
|
|
6595
6595
|
"access": "public",
|
|
@@ -6599,7 +6599,7 @@
|
|
|
6599
6599
|
},
|
|
6600
6600
|
{
|
|
6601
6601
|
"file": "packages/@ember/-internals/glimmer/lib/components/textarea.ts",
|
|
6602
|
-
"line":
|
|
6602
|
+
"line": 127,
|
|
6603
6603
|
"description": "See [Ember.Templates.components.Textarea](/ember/release/classes/Ember.Templates.components/methods/Textarea?anchor=Textarea)",
|
|
6604
6604
|
"itemtype": "method",
|
|
6605
6605
|
"name": "textarea",
|
|
@@ -6613,7 +6613,7 @@
|
|
|
6613
6613
|
},
|
|
6614
6614
|
{
|
|
6615
6615
|
"file": "packages/@ember/-internals/glimmer/lib/components/textarea.ts",
|
|
6616
|
-
"line":
|
|
6616
|
+
"line": 136,
|
|
6617
6617
|
"description": "An opaque interface which can be imported and used in strict-mode\ntemplates to call <Textarea>.\n\nSee [Ember.Templates.components.Textarea](/ember/release/classes/Ember.Templates.components/methods/Textarea?anchor=Textarea).",
|
|
6618
6618
|
"itemtype": "method",
|
|
6619
6619
|
"name": "Textarea",
|
|
@@ -6635,7 +6635,7 @@
|
|
|
6635
6635
|
{
|
|
6636
6636
|
"file": "packages/@ember/-internals/glimmer/lib/helpers/array.ts",
|
|
6637
6637
|
"line": 5,
|
|
6638
|
-
"description": "Use the `{{array}}` helper to create an array to pass as an option to your\ncomponents.\n\n```handlebars\n<MyComponent @people={{array\n 'Tom Dale'\n 'Yehuda Katz'\n this.myOtherPerson}}\n/>\n```\n or\n```handlebars\n{{
|
|
6638
|
+
"description": "Use the `{{array}}` helper to create an array to pass as an option to your\ncomponents.\n\n```handlebars\n<MyComponent @people={{array\n 'Tom Dale'\n 'Yehuda Katz'\n this.myOtherPerson}}\n/>\n```\n or\n```handlebars\n{{yield people=(array\n 'Tom Dale'\n 'Yehuda Katz'\n this.myOtherPerson)\n}}\n```\n\nWould result in an object such as:\n\n```js\n['Tom Dale', 'Yehuda Katz', this.get('myOtherPerson')]\n```\n\nWhere the 3rd item in the array is bound to updates of the `myOtherPerson` property.\n \nThe `array` helper is built-in keyword and does not need to be imported as of v7.1.0.",
|
|
6639
6639
|
"itemtype": "method",
|
|
6640
6640
|
"name": "array",
|
|
6641
6641
|
"params": [
|
|
@@ -6658,7 +6658,7 @@
|
|
|
6658
6658
|
{
|
|
6659
6659
|
"file": "packages/@ember/-internals/glimmer/lib/helpers/component.ts",
|
|
6660
6660
|
"line": 5,
|
|
6661
|
-
"description": "The `
|
|
6661
|
+
"description": "The `component` helper is used to package a Component with initial arguments.\nThe included arguments can then be merged during the final invocation.\n\nSee [Component](/ember/release/modules/@glimmer%2Fcomponent/) for\nadditional information on how a `Component` functions.\n\nThis is similar to the concept of Partial Application.\n \nFor example, given a `FullName` component:\n\n```app/components/full-name.gjs\nimport MyInputComponent from './my-input-component';\n\n<template>\n {{yield (component MyInputComponent value=@model.name placeholder=\"Username\")}}\n</template>\n```\n\nThe yielded component can be invoked by the calling component.\nSee the following snippet:\n\n```app/components/person-form.gjs\nimport FullName from './full-name';\n \n<template>\n <FullName @model={{@model}} as |Field|>\n <Field />\n </FullName>\n</template>\n```\n\nWhich will output an input whose value is already bound to `@model.name` and `placeholder`\nis \"Username\".\n \nAny arguments passed at the invocation site of the component will override those applied via\nthe `component` helper. For example, if the invocation site of the component is:\n\n```app/components/person-form.gjs\nimport FullName from './full-name';\n\n<template>\n <FullName @model={{@model}} as |Field|>\n <Field @placeholder=\"Your name\" />\n </FullName>\n</template>\n```\n\nThe output will be an input whose value is bound to `@model.name` and `placeholder`\nis \"Your name\".\n \nThe `component` helper is built-in and does not need to be imported. \n \nPrior to Strict Mode aka \"Template Tag\" or gjs, the component helper was also used to invoke\ncomponents dynamically. This is no longer necessary, and they can be directly invoked, as above.\n\n### Dynamic Component Invocation\n\n```app/templates/application.gjs\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { component } from '@ember/helper';\nimport LiveUpdatingChart from '../components/live-updating-chart';\nimport MarketCloseSummary from '../components/market-close-summary';\n\nexport default class Application extends Component {\n @tracked isMarketOpen = false;\n\n get infographicComponent() {\n return this.isMarketOpen ? LiveUpdatingChart : MarketCloseSummary;\n }\n\n <template>\n {{!-- The component can be invoked directly --}}\n <this.infographicComponent />\n \n {{!-- The component helper here is no longer necessary --}}\n {{component this.infographicComponentName}}\n </template>\n}\n```",
|
|
6662
6662
|
"itemtype": "method",
|
|
6663
6663
|
"name": "component",
|
|
6664
6664
|
"since": "1.11.0",
|
|
@@ -6670,7 +6670,7 @@
|
|
|
6670
6670
|
{
|
|
6671
6671
|
"file": "packages/@ember/-internals/glimmer/lib/helpers/concat.ts",
|
|
6672
6672
|
"line": 5,
|
|
6673
|
-
"description": "Concatenates the given arguments into a string.\n\nExample:\n\n```
|
|
6673
|
+
"description": "Concatenates the given arguments into a string.\n\nExample:\n\n```gjs\nimport { concat } from '@ember/helper';\n \n<template>\n {{yield (concat firstName \" \" lastName)}}\n\n {{! would yield name=\"<first name value> <last name value>\" to the component}}\n</template>\n```\n\nFor invocation of components, you don't need concat at all.\n\n```handlebars\n<SomeComponent @name=\"{{firstName}} {{lastName}}\" />\n```",
|
|
6674
6674
|
"access": "public",
|
|
6675
6675
|
"tagname": "",
|
|
6676
6676
|
"itemtype": "method",
|
|
@@ -6682,7 +6682,7 @@
|
|
|
6682
6682
|
{
|
|
6683
6683
|
"file": "packages/@ember/-internals/glimmer/lib/helpers/each-in.ts",
|
|
6684
6684
|
"line": 13,
|
|
6685
|
-
"description": "The `{{#each}}`
|
|
6685
|
+
"description": "The `{{#each}}` keyword loops over elements in a collection. It is an extension\nof the base Handlebars `{{#each}}` helper.\n\nThe default behavior of `{{#each}}` is to yield its inner block once for every\nitem in an array passing the item as the first block parameter.\n\nAssuming the `@developers` argument contains this array:\n\n```javascript\n[{ name: 'Yehuda' },{ name: 'Tom' }, { name: 'Paul' }];\n```\n\n```handlebars\n<ul>\n {{#each @developers as |person|}}\n <li>Hello, {{person.name}}!</li>\n {{/each}}\n</ul>\n```\n\nThe same rules apply to arrays of primitives.\n\n```javascript\n['Yehuda', 'Tom', 'Paul']\n```\n\n```handlebars\n<ul>\n {{#each @developerNames as |name|}}\n <li>Hello, {{name}}!</li>\n {{/each}}\n</ul>\n```\n\nDuring iteration, the index of each item in the array is provided as a second block\nparameter.\n\n```handlebars\n<ul>\n {{#each @developers as |person index|}}\n <li>Hello, {{person.name}}! You're number {{index}} in line</li>\n {{/each}}\n</ul>\n```\n \n`#each` is a keyword and does not need to be imported. \n\n### Specifying Keys\n\nIn order to improve rendering speed, Ember will try to reuse the DOM elements\nwhere possible. Specifically, if the same item is present in the array both\nbefore and after the change, its DOM output will be reused.\n\nThe `key` option is used to tell Ember how to determine if the items in the\narray being iterated over with `{{#each}}` has changed between renders. By\ndefault the item's object identity is used.\n\nThis is usually sufficient, so in most cases, the `key` option is simply not\nneeded. However, in some rare cases, the objects' identities may change even\nthough they represent the same underlying data.\n\nFor example:\n\n```javascript\npeople.map(person => {\n return { ...person, type: 'developer' };\n});\n```\n\nIn this case, each time the `people` array is `map`-ed over, it will produce\nan new array with completely different objects between renders. In these cases,\nyou can help Ember determine how these objects related to each other with the\n`key` option:\n\n```handlebars\n<ul>\n {{#each @developers key=\"name\" as |person|}}\n <li>Hello, {{person.name}}!</li>\n {{/each}}\n</ul>\n```\n\nBy doing so, Ember will use the value of the property specified (`person.name`\nin the example) to find a \"match\" from the previous render. That is, if Ember\nhas previously seen an object from the `@developers` array with a matching\nname, its DOM elements will be re-used.\n\nThere are two special values for `key`:\n\n * `@index` - The index of the item in the array.\n * `@identity` - The item in the array itself.\n\n### {{else}} condition\n\n`{{#each}}` can have a matching `{{else}}`. The contents of this block will render\nif the collection is empty.\n\n```handlebars\n<ul>\n {{#each @developers as |person|}}\n <li>{{person.name}} is available!</li>\n {{else}}\n <li>Sorry, nobody is available for this task.</li>\n {{/each}}\n</ul>\n```",
|
|
6686
6686
|
"itemtype": "method",
|
|
6687
6687
|
"name": "each",
|
|
6688
6688
|
"access": "public",
|
|
@@ -6692,8 +6692,8 @@
|
|
|
6692
6692
|
},
|
|
6693
6693
|
{
|
|
6694
6694
|
"file": "packages/@ember/-internals/glimmer/lib/helpers/each-in.ts",
|
|
6695
|
-
"line":
|
|
6696
|
-
"description": "The `{{each-in}}`
|
|
6695
|
+
"line": 126,
|
|
6696
|
+
"description": "The `{{#each-in}}` keyword loops over properties on an object.\n\nFor example, given this component definition:\n\n```app/components/developer-details.gjs\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n @tracked developer = {\n \"name\": \"Shelly Sails\",\n \"age\": 42\n };\n \n <template>\n <ul>\n {{#each-in this.developer as |key value|}}\n <li>{{key}}: {{value}}</li>\n {{/each-in}}\n </ul>\n </template>\n}\n```\n\nThis template would display all properties on the `developer`\nobject in a list, outputting their name and age:\n\n```html\n<ul>\n <li>name: Shelly Sails</li>\n <li>age: 42</li>\n</ul>\n```\n \n`#each-in` is a keyword and does not need to be imported.",
|
|
6697
6697
|
"itemtype": "method",
|
|
6698
6698
|
"name": "each-in",
|
|
6699
6699
|
"access": "public",
|
|
@@ -6705,7 +6705,7 @@
|
|
|
6705
6705
|
{
|
|
6706
6706
|
"file": "packages/@ember/-internals/glimmer/lib/helpers/element.ts",
|
|
6707
6707
|
"line": 84,
|
|
6708
|
-
"description": "The `element` helper lets you dynamically set the tag name of an element.\n\n```handlebars\n{{#let (element @tagName) as |Tag|}}\n <Tag class=\"my-element\">Hello</Tag>\n{{/let}}\n```\n\nWhen `@tagName` is `\"h1\"`, this renders `<h1 class=\"my-element\">Hello</h1>`.\n\nWhen `@tagName` is an empty string `\"\"`, the block content is rendered without\na wrapping element.\n\nPassing `null`, `undefined`, or non-string values will throw an assertion error.\n\nChanging the tag name will tear down and recreate the element and its contents.",
|
|
6708
|
+
"description": "The `element` helper lets you dynamically set the tag name of an element.\n\n```handlebars\n{{#let (element @tagName) as |Tag|}}\n <Tag class=\"my-element\">Hello</Tag>\n{{/let}}\n```\n\nWhen `@tagName` is `\"h1\"`, this renders `<h1 class=\"my-element\">Hello</h1>`.\n\nWhen `@tagName` is an empty string `\"\"`, the block content is rendered without\na wrapping element.\n\nPassing `null`, `undefined`, or non-string values will throw an assertion error.\n\nChanging the tag name will tear down and recreate the element and its contents.\n \nThe `element` helper is built-in and does not need to be imported.",
|
|
6709
6709
|
"itemtype": "method",
|
|
6710
6710
|
"name": "element",
|
|
6711
6711
|
"access": "public",
|
|
@@ -6716,7 +6716,7 @@
|
|
|
6716
6716
|
{
|
|
6717
6717
|
"file": "packages/@ember/-internals/glimmer/lib/helpers/fn.ts",
|
|
6718
6718
|
"line": 5,
|
|
6719
|
-
"description": "The `fn` helper allows you to ensure a function that you are passing off\nto another component, helper, or modifier has access to arguments that are\navailable in the template.\n\nFor example, if you have an `each` helper looping over a number of items, you\nmay need to pass a function that expects to receive the item as an argument\nto a component invoked within the loop. Here's how you could use the `fn`\nhelper to pass both the function and its arguments together:\n\n
|
|
6719
|
+
"description": "The `fn` helper allows you to ensure a function that you are passing off\nto another component, helper, or modifier has access to arguments that are\navailable in the template.\n\nFor example, if you have an `each` helper looping over a number of items, you\nmay need to pass a function that expects to receive the item as an argument\nto a component invoked within the loop. Here's how you could use the `fn`\nhelper to pass both the function and its arguments together:\n\n```app/components/items-listing.gjs\n<template>\n {{#each @items as |item|}}\n <DisplayItem @item=item @select={{fn this.handleSelected item}} />\n {{/each}}\n</template>\n```\n\n```app/components/items-list.gjs\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class ItemsList extends Component {\n @action\n handleSelected(item) {\n // ...snip...\n }\n}\n```\n\nIn this case the `DisplayItem` component will receive a normal function\nthat it can invoke. When it invokes the function, the `handleSelected`\nfunction will receive the `item` and any arguments passed, thanks to the\n`fn` helper.\n\nLet's take look at what that means in a couple circumstances:\n\n- When invoked as `this.args.select()` the `handleSelected` function will\n receive the `item` from the loop as its first and only argument.\n- When invoked as `this.args.select('foo')` the `handleSelected` function\n will receive the `item` from the loop as its first argument and the\n string `'foo'` as its second argument.\n\nIn the example above, we used `@action` to ensure that `handleSelected` is\nproperly bound to the `items-list`, but let's explore what happens if we\nleft out `@action`:\n\n```app/components/items-list.gjs\nimport Component from '@glimmer/component';\n\nexport default class ItemsList extends Component {\n handleSelected(item) {\n // ...snip...\n }\n}\n```\n\nIn this example, when `handleSelected` is invoked inside the `display-item`\ncomponent, it will **not** have access to the component instance. In other\nwords, it will have no `this` context, so please make sure your functions\nare bound (via `@action` or other means) before passing into `fn`!\n\nSee also [partial application](https://en.wikipedia.org/wiki/Partial_application).\n \n`fn` is built-in and does not need to be imported.",
|
|
6720
6720
|
"itemtype": "method",
|
|
6721
6721
|
"name": "fn",
|
|
6722
6722
|
"access": "public",
|
|
@@ -6728,7 +6728,7 @@
|
|
|
6728
6728
|
{
|
|
6729
6729
|
"file": "packages/@ember/-internals/glimmer/lib/helpers/get.ts",
|
|
6730
6730
|
"line": 5,
|
|
6731
|
-
"description": "Dynamically look up a property on an object or an element in an array.\nThe second argument to `{{get}}` should have a string or number value,\nalthough it can be bound.\n\nFor example, these two usages are equivalent:\n\n```app/components/developer-detail.
|
|
6731
|
+
"description": "Dynamically look up a property on an object or an element in an array.\nThe second argument to `{{get}}` should have a string or number value,\nalthough it can be bound.\n\nFor example, these two usages are equivalent:\n\n```app/components/developer-detail.gjs\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { get } from '@ember/object';\n\nexport default class extends Component {\n @tracked developer = {\n name: \"Sandi Metz\",\n language: \"Ruby\"\n }\n \n <template>\n {{this.developer.name}}\n {{get this.developer \"name\"}}\n </template>\n}\n```\n \nIf there were several facts about a person, the `{{get}}` helper can dynamically\npick one:\n\n```app/templates/application.gjs\nimport DeveloperDetail from '../components/developer-detail';\n\n<template>\n <DeveloperDetail @factName=\"language\" />\n</template\n```\n\n```handlebars\n{{get this.developer @factName}}\n```\n\nFor a more complex example, this template would allow the user to switch\nbetween showing the user's name and preferred coding language with a click:\n\n```app/components/developer-detail.gjs\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { get } from '@ember/object';\n\nexport default class extends Component {\n @tracked developer = {\n name: \"Sandi Metz\",\n language: \"Ruby\"\n }\n\n @tracked currentFact = 'name'\n\n @action\n showFact(fact) {\n this.currentFact = fact;\n }\n \n <template>\n {{get this.developer this.currentFact}}\n\n <button {{on 'click' (fn this.showFact \"name\")}}>Show name</button>\n <button {{on 'click' (fn this.showFact \"language\")}}>Show language</button>\n </template>\n}\n```\n\nThe `{{get}}` helper can also be used for array element access via index.\nThis would display the value of the first element in the array `this.names`:\n\n```handlebars\n{{get this.names 0}}\n```\n\nArray element access also works with a dynamic second argument:\n\n```handlebars\n{{get this.names @index}}\n```",
|
|
6732
6732
|
"access": "public",
|
|
6733
6733
|
"tagname": "",
|
|
6734
6734
|
"itemtype": "method",
|
|
@@ -6740,7 +6740,7 @@
|
|
|
6740
6740
|
{
|
|
6741
6741
|
"file": "packages/@ember/-internals/glimmer/lib/helpers/hash.ts",
|
|
6742
6742
|
"line": 5,
|
|
6743
|
-
"description": "Use the `{{hash}}` helper to create a hash to pass as an option to your\ncomponents. This is
|
|
6743
|
+
"description": "Use the `{{hash}}` helper to create a hash to pass as an option to your\ncomponents. This is especially useful for contextual components where you can\njust yield a hash:\n\n```handlebars\n{{yield (hash\n name='Sarah'\n title=office\n)}}\n```\n\nWould result in an object such as:\n\n```js\n{ name: 'Sarah', title: this.get('office') }\n```\n\nWhere the `title` is bound to updates of the `office` property.\n\nNote that the hash is an empty object with no prototype chain, therefore\ncommon methods like `toString` are not available in the resulting hash.\nIf you need to use such a method, you can use the `call` or `apply`\napproach:\n\n```js\nfunction toString(obj) {\n return Object.prototype.toString.apply(obj);\n}\n```\n \nThe `hash` helper is a built-in keyword and does not need to be imported as of v7.1.0.",
|
|
6744
6744
|
"itemtype": "method",
|
|
6745
6745
|
"name": "hash",
|
|
6746
6746
|
"params": [
|
|
@@ -6775,7 +6775,7 @@
|
|
|
6775
6775
|
{
|
|
6776
6776
|
"file": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts",
|
|
6777
6777
|
"line": 5,
|
|
6778
|
-
"description": "The `if` helper allows you to conditionally render one of two branches,\ndepending on the \"truthiness\" of a property.\nFor example the following values are all falsey: `false`, `undefined`, `null`, `\"\"`, `0`, `NaN` or an empty array.\n\nThis helper has two forms, block and inline.\n\n## Block form\n\nYou can use the block form of `if` to conditionally render a section of the template.\n\nTo use it, pass the conditional value to the `if` helper,\nusing the block form to wrap the section of template you want to conditionally render.\nLike so:\n\n```app/templates/application.
|
|
6778
|
+
"description": "The `if` helper allows you to conditionally render one of two branches,\ndepending on the \"truthiness\" of a property.\nFor example the following values are all falsey: `false`, `undefined`, `null`, `\"\"`, `0`, `NaN` or an empty array.\n\nThis helper has two forms, block and inline.\n\n## Block form\n\nYou can use the block form of `if` to conditionally render a section of the template.\n\nTo use it, pass the conditional value to the `if` helper,\nusing the block form to wrap the section of template you want to conditionally render.\nLike so:\n\n```app/templates/application.gjs\nimport Weather from '../components/weather';\n \n<template>\n <Weather />\n</template>\n```\n\n```app/components/weather.gjs\n<template>\n {{! will not render because greeting is undefined}}\n {{#if @isRaining}}\n Yes, grab an umbrella!\n {{/if}}\n</template>\n```\n\nYou can also define what to show if the property is falsey by using\nthe `else` helper.\n\n```app/components/weather.gjs\n<template>\n {{#if @isRaining}}\n Yes, grab an umbrella!\n {{else}}\n No, it's lovely outside!\n {{/if}}\n</template>\n```\n\nYou are also able to combine `else` and `if` helpers to create more complex\nconditional logic.\n\nFor the following template:\n\n ```app/components/weather.gjs\n<template>\n {{#if @isRaining}}\n Yes, grab an umbrella!\n {{else if @isCold}}\n Grab a coat, it's chilly!\n {{else}}\n No, it's lovely outside!\n {{/if}}\n</template> \n```\n\nIf you call it by saying `isCold` is true:\n\n```app/templates/application.gjs\nimport Weather from '../components/weather';\n \n<template>\n <Weather @isCold={{true}} />\n</template>\n```\n\nThen `Grab a coat, it's chilly!` will be rendered.\n\n## Inline form\n\nThe inline `if` helper conditionally renders a single property or string.\n\nIn this form, the `if` helper receives three arguments, the conditional value,\nthe value to render when truthy, and the value to render when falsey.\n\nFor example, if `useLongGreeting` is truthy, the following:\n\n```app/templates/application.gjs\nimport Greeting from '../components/greeting';\n\n<template>\n <Greeting @useLongGreeting={{true}} />\n<template>\n```\n\n```app/components/greeting.gjs\n<template>\n {{if @useLongGreeting \"Hello\" \"Hi\"}} Alex\n<template>\n```\n\nWill render:\n\n```html\nHello Alex\n```\n\nOne detail to keep in mind is that both branches of the `if` helper will be evaluated,\nso if you have `{{if condition \"foo\" (expensive-operation \"bar\")`,\n`expensive-operation` will always calculate.\n \n`if` is built-in and does not need to be imported.",
|
|
6779
6779
|
"itemtype": "method",
|
|
6780
6780
|
"name": "if",
|
|
6781
6781
|
"access": "public",
|
|
@@ -6785,8 +6785,8 @@
|
|
|
6785
6785
|
},
|
|
6786
6786
|
{
|
|
6787
6787
|
"file": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts",
|
|
6788
|
-
"line":
|
|
6789
|
-
"description": "The `unless` helper is the inverse of the `if` helper. It displays if a value\nis falsey (\"not true\" or \"is false\"). Example values that will display with\n`unless`: `false`, `undefined`, `null`, `\"\"`, `0`, `NaN` or an empty array.\n\n## Inline form\n\nThe inline `unless` helper conditionally renders a single property or string.\nThis helper acts like a ternary operator. If the first property is falsy,\nthe second argument will be displayed, otherwise, the third argument will be\ndisplayed\n\nFor example, if you pass a falsey `useLongGreeting` to the `Greeting` component:\n\n```app/templates/application.
|
|
6788
|
+
"line": 119,
|
|
6789
|
+
"description": "The `unless` helper is the inverse of the `if` helper. It displays if a value\nis falsey (\"not true\" or \"is false\"). Example values that will display with\n`unless`: `false`, `undefined`, `null`, `\"\"`, `0`, `NaN` or an empty array.\n\n## Inline form\n\nThe inline `unless` helper conditionally renders a single property or string.\nThis helper acts like a ternary operator. If the first property is falsy,\nthe second argument will be displayed, otherwise, the third argument will be\ndisplayed\n\nFor example, if you pass a falsey `useLongGreeting` to the `Greeting` component:\n\n```app/templates/application.gjs\nimport Greeting from '../components/greeting';\n \n<template>\n <Greeting @useLongGreeting={{false}} />\n</template>\n```\n\n```app/components/greeting.gjs\n<template>\n {{unless @useLongGreeting \"Hi\" \"Hello\"}} Ben\n</template>\n```\n\nThen it will display:\n\n```html\nHi Ben\n```\n\n## Block form\n\nLike the `if` helper, the `unless` helper also has a block form.\n\nThe following will not render anything:\n\n```app/templates/application.gjs\nimport Greeting from '../components/greeting';\n \n<template>\n <Greeting />\n</template>\n```\n\n```app/components/greeting.gjs\n<template>\n {{#unless @greeting}}\n No greeting was found. Why not set one?\n {{/unless}}\n</template>\n```\n\nYou can also use an `else` helper with the `unless` block. The\n`else` will display if the value is truthy.\n\nIf you have the following component:\n\n```app/components/logged-in.gjs\n<template>\n {{#unless @userData}}\n Please login.\n {{else}}\n Welcome back!\n {{/unless}}\n</template>\n```\n\nCalling it with a truthy `userData`:\n\n```app/templates/application.gjs\nimport LoggedIn from '../components/logged-in';\n \n<template>\n <LoggedIn @userData={{hash username=\"Zoey\"}} />\n</template>\n```\n\nWill render:\n\n```html\nWelcome back!\n```\n\nand calling it with a falsey `userData`:\n\n```app/templates/application.gjs\nimport LoggedIn from '../components/logged-in';\n\n<template>\n <LoggedIn @userData={{false}} />\n</template>\n```\n\nWill render:\n\n```html\nPlease login.\n```\n \n`unless` is built-in and does not need to be imported.",
|
|
6790
6790
|
"itemtype": "method",
|
|
6791
6791
|
"name": "unless",
|
|
6792
6792
|
"access": "public",
|
|
@@ -6827,7 +6827,7 @@
|
|
|
6827
6827
|
{
|
|
6828
6828
|
"file": "packages/@ember/-internals/glimmer/lib/helpers/mut.ts",
|
|
6829
6829
|
"line": 9,
|
|
6830
|
-
"description": "The `mut` helper
|
|
6830
|
+
"description": "The `mut` helper is a shortcut for updating for args.\n \nHowever, defining update functions on your backing class is preferable to using `mut`.\n \nMore directly: Don't use `mut`. \n\nThe `mut` helper, when used with `fn`, will return a function that\nsets the value passed to `mut` to its first argument. As an example, we can create a\nbutton that increments a value passing the value directly to the `fn`:\n\n```handlebars\n<MyChild @childClickCount={{this.totalClicks}} @clickCountChange={{fn (mut this.totalClicks)}} />\n```\n\nThe child `Component` would invoke the function with the new click count:\n\n```app/components/my-child.gjs\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\n \nexport default class MyChild extends Component {\n @action\n update() {\n this.args.clickCountChange(this.args.childClickCount + 1);\n }\n \n <template>\n <button {{on \"click\" this.update}}>\n Click me!\n </button>\n </template>\n}\n```\n\nThe `mut` helper changes the `totalClicks` value to what was provided as the `fn` argument.",
|
|
6831
6831
|
"itemtype": "method",
|
|
6832
6832
|
"name": "mut",
|
|
6833
6833
|
"params": [
|
|
@@ -6846,7 +6846,7 @@
|
|
|
6846
6846
|
{
|
|
6847
6847
|
"file": "packages/@ember/-internals/glimmer/lib/helpers/page-title.ts",
|
|
6848
6848
|
"line": 5,
|
|
6849
|
-
"description": "`page-title` allows you to set the title of any page in your application and\nappend additional titles for each route. For complete documentation, see\nhttps://github.com/ember-cli/ember-page-title.\n\n```
|
|
6849
|
+
"description": "`page-title` allows you to set the title of any page in your application and\nappend additional titles for each route. For complete documentation, see\nhttps://github.com/ember-cli/ember-page-title.\n\n```gjs\nimport pageTitle from 'ember-page-title/helpers/page-title';\n\n<template>\n {{pageTitle \"My Page Title\" }}\n</template>\n```",
|
|
6850
6850
|
"itemtype": "method",
|
|
6851
6851
|
"name": "page-title",
|
|
6852
6852
|
"params": [
|
|
@@ -6864,7 +6864,7 @@
|
|
|
6864
6864
|
{
|
|
6865
6865
|
"file": "packages/@ember/-internals/glimmer/lib/helpers/readonly.ts",
|
|
6866
6866
|
"line": 9,
|
|
6867
|
-
"description": "The `readonly` helper let's you specify that a binding is one-way only,\ninstead of two-way.\nWhen you pass a `readonly` binding from an outer context (e.g. parent component),\nto to an inner context (e.g. child component), you are saying that changing that\nproperty in the inner context does not change the value in the outer context.\n\nTo specify that a binding is read-only, when invoking the child `Component`:\n\n```app/components/my-parent.js\nexport default class MyParent extends Component {\n totalClicks = 3;\n}\n```\n\
|
|
6867
|
+
"description": "The `readonly` helper let's you specify that a binding is one-way only,\ninstead of two-way.\n\nThis is a vestigial helper from the days of `@ember/component` and does not apply to\ncomponents extending from `@glimmer/component`.\n \nWhen you pass a `readonly` binding from an outer context (e.g. parent component),\nto to an inner context (e.g. child component), you are saying that changing that\nproperty in the inner context does not change the value in the outer context.\n\nTo specify that a binding is read-only, when invoking the child `Component`:\n\n```app/components/my-parent.js\nexport default class MyParent extends Component {\n totalClicks = 3;\n}\n```\n\nNow, when you update `childClickCount`:\n\n```app/components/my-child.js\nexport default class MyChild extends Component {\n click() {\n this.incrementProperty('childClickCount');\n }\n}\n```\n\nThe value updates in the child component, but not the parent component:\n\n```app/templates/components/my-child.hbs\n{{log childClickCount}} //-> 4\n```\n\n```app/templates/components/my-parent.hbs\n{{log totalClicks}} //-> 3\n<MyChild @childClickCount={{readonly totalClicks}} />\n```\nor\n```app/templates/components/my-parent.hbs\n{{log totalClicks}} //-> 3\n{{my-child childClickCount=(readonly totalClicks)}}\n```\n\n### Objects and Arrays\n\nWhen passing a property that is a complex object (e.g. object, array) instead of a primitive object (e.g. number, string),\nonly the reference to the object is protected using the readonly helper.\nThis means that you can change properties of the object both on the parent component, as well as the child component.\nThe `readonly` binding behaves similar to the `const` keyword in JavaScript.\n\nLet's look at an example:\n\nFirst let's set up the parent component:\n\n```app/components/my-parent.js\nimport Component from '@ember/component';\n\nexport default class MyParent extends Component {\n clicks: null,\n\n init() {\n this._super(...arguments);\n this.set('clicks', { total: 3 });\n }\n}\n```\n\n```app/templates/components/my-parent.hbs\n{{log clicks.total}} //-> 3\n<MyChild @childClicks={{readonly clicks}} />\n```\n```app/templates/components/my-parent.hbs\n{{log clicks.total}} //-> 3\n{{my-child childClicks=(readonly clicks)}}\n```\n\nNow, if you update the `total` property of `childClicks`:\n\n```app/components/my-child.js\nimport Component from '@ember/component';\n\nexport default class MyChild extends Component {\n click() {\n this.get('clicks').incrementProperty('total');\n }\n}\n```\n\nYou will see the following happen:\n\n```app/templates/components/my-parent.hbs\n{{log clicks.total}} //-> 4\n<MyChild @childClicks={{readonly clicks}} />\n```\nor\n```app/templates/components/my-parent.hbs\n{{log clicks.total}} //-> 4\n{{my-child childClicks=(readonly clicks)}}\n```\n\n```app/templates/components/my-child.hbs\n{{log childClicks.total}} //-> 4\n```",
|
|
6868
6868
|
"itemtype": "method",
|
|
6869
6869
|
"name": "readonly",
|
|
6870
6870
|
"params": [
|
|
@@ -6906,7 +6906,7 @@
|
|
|
6906
6906
|
{
|
|
6907
6907
|
"file": "packages/@ember/-internals/glimmer/lib/modifiers/on.ts",
|
|
6908
6908
|
"line": 5,
|
|
6909
|
-
"description": "The `{{on}}` modifier lets you easily add event listeners (it uses\n[EventTarget.addEventListener](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener)\ninternally).\n\nFor example, if you'd like to run a function on your component when a `<button>`\nin the components template is clicked you might do something like:\n\n```app/components/like-post.
|
|
6909
|
+
"description": "The `{{on}}` modifier lets you easily add event listeners (it uses\n[EventTarget.addEventListener](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener)\ninternally).\n\nFor example, if you'd like to run a function on your component when a `<button>`\nin the components template is clicked you might do something like:\n\n```app/components/like-post.gjs\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class LikePost extends Component {\n @action\n saveLike() {\n // someone likes your post!\n // better send a request off to your server...\n }\n \n <template>\n <button {{on 'click' this.saveLike}}>Like this post!</button>\n </template>\n}\n```\n\n### Arguments\n\n`{{on}}` accepts two positional arguments, and a few named arguments.\n\nThe positional arguments are:\n\n- `event` -- the name to use when calling `addEventListener`\n- `callback` -- the function to be passed to `addEventListener`\n\nThe named arguments are:\n\n- capture -- a `true` value indicates that events of this type will be dispatched\n to the registered listener before being dispatched to any EventTarget beneath it\n in the DOM tree.\n- once -- indicates that the listener should be invoked at most once after being\n added. If true, the listener would be automatically removed when invoked.\n- passive -- if `true`, indicates that the function specified by listener will never\n call preventDefault(). If a passive listener does call preventDefault(), the user\n agent will do nothing other than generate a console warning. See\n [Improving scrolling performance with passive listeners](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Improving_scrolling_performance_with_passive_listeners)\n to learn more.\n\nThe callback function passed to `{{on}}` will receive any arguments that are passed\nto the event handler. Most commonly this would be the `event` itself.\n\nIf you would like to pass additional arguments to the function you should use\nthe `{{fn}}` helper.\n\nFor example, in our example case above if you'd like to pass in the post that\nwas being liked when the button is clicked you could do something like:\n\n```hbs\n<button {{on 'click' (fn this.saveLike @post)}}>Like this post!</button>\n```\n\nIn this case, the `saveLike` function will receive two arguments: the click event\nand the value of `@post`.\n\n### Function Context\n\nIn the example above, we used `@action` to ensure that `likePost` is\nproperly bound to the `LikePost` Component, but let's explore what happens if we\nleft out `@action`:\n\n```app/components/like-post.gjs\nimport Component from '@glimmer/component';\n\nexport default class LikePost extends Component {\n saveLike() {\n // ...snip...\n }\n}\n```\n\nIn this example, when the button is clicked `saveLike` will be invoked,\nit will **not** have access to the component instance. In other\nwords, it will have no `this` context, so please make sure your functions\nare bound (via `@action` or other means) before passing into `on`!",
|
|
6910
6910
|
"itemtype": "method",
|
|
6911
6911
|
"name": "on",
|
|
6912
6912
|
"access": "public",
|
|
@@ -6918,7 +6918,7 @@
|
|
|
6918
6918
|
{
|
|
6919
6919
|
"file": "packages/@ember/-internals/glimmer/lib/syntax/in-element.ts",
|
|
6920
6920
|
"line": 5,
|
|
6921
|
-
"description": "The `in-element` helper renders its block content outside of the regular flow,\ninto a DOM element given by its `destinationElement` positional argument.\n\nCommon use cases - often referred to as \"portals\" or \"wormholes\" - are rendering\ndropdowns, modals or tooltips close to the root of the page to bypass CSS overflow\nrules, or to render content to parts of the page that are outside of the control\nof the Ember app itself (e.g. embedded into a static or server rendered HTML page).\n\n```handlebars\n{{#in-element this.destinationElement}}\n <div>Some content</div>\n{{/in-element}}\n```\n\n### Arguments\n\n`{{in-element}}` requires a single positional argument:\n\n- `destinationElement` -- the DOM element to render into. It must exist at the time\nof rendering.\n\nIt also supports an optional named argument:\n\n- `insertBefore` -- by default the DOM element's content is replaced when used as\n`destinationElement`. Passing `null` to `insertBefore` changes the behaviour to\nappend the block content to the end of any existing content. Any other value than\n`null` is currently not supported.\n\n For example:\n\n ```handlebars\n {{#in-element this.destinationElement insertBefore=null}}\n <div>Some content</div>\n {{/in-element}}\n
|
|
6921
|
+
"description": "The `in-element` helper renders its block content outside of the regular flow,\ninto a DOM element given by its `destinationElement` positional argument.\n\nCommon use cases - often referred to as \"portals\" or \"wormholes\" - are rendering\ndropdowns, modals or tooltips close to the root of the page to bypass CSS overflow\nrules, or to render content to parts of the page that are outside of the control\nof the Ember app itself (e.g. embedded into a static or server rendered HTML page).\n\n```handlebars\n{{#in-element this.destinationElement}}\n <div>Some content</div>\n{{/in-element}}\n```\n\n### Arguments\n\n`{{in-element}}` requires a single positional argument:\n\n- `destinationElement` -- the DOM element to render into. It must exist at the time\nof rendering.\n\nIt also supports an optional named argument:\n\n- `insertBefore` -- by default the DOM element's content is replaced when used as\n`destinationElement`. Passing `null` to `insertBefore` changes the behaviour to\nappend the block content to the end of any existing content. Any other value than\n`null` is currently not supported.\n\n For example:\n\n ```handlebars\n {{#in-element this.destinationElement insertBefore=null}}\n <div>Some content</div>\n {{/in-element}}\n ```\n\n`in-element` is built-in and does not need to be imported.",
|
|
6922
6922
|
"itemtype": "method",
|
|
6923
6923
|
"name": "in-element",
|
|
6924
6924
|
"access": "public",
|
|
@@ -6929,7 +6929,7 @@
|
|
|
6929
6929
|
{
|
|
6930
6930
|
"file": "packages/@ember/-internals/glimmer/lib/syntax/let.ts",
|
|
6931
6931
|
"line": 5,
|
|
6932
|
-
"description": "The `let` helper receives one or more positional arguments and yields\nthem out as block params.\n\nThis allows the developer to introduce shorter names for certain computations\nin the template.\n\nThis is especially useful if you are passing properties to a component\nthat receives a lot of options and you want to clean up the invocation.\n\nFor the following example, the template receives a `post` object with\n`content` and `title` properties.\n\nWe are going to call the `my-post` component, passing a title which is\nthe title of the post suffixed with the name of the blog, the content\nof the post, and a series of options defined in-place.\n\n```handlebars\n{{#let\n (concat post.title ' | The Ember.js Blog')\n post.content\n (hash\n theme=\"high-contrast\"\n enableComments=true\n )\n as |title content options|\n}}\n <MyPost @title={{title}} @content={{content}} @options={{options}} />\n{{/let}}\n ```\n
|
|
6932
|
+
"description": "The `let` helper receives one or more positional arguments and yields\nthem out as block params.\n\nThis allows the developer to introduce shorter names for certain computations\nin the template.\n\nThis is especially useful if you are passing properties to a component\nthat receives a lot of options and you want to clean up the invocation.\n\nFor the following example, the template receives a `post` object with\n`content` and `title` properties.\n\nWe are going to call the `my-post` component, passing a title which is\nthe title of the post suffixed with the name of the blog, the content\nof the post, and a series of options defined in-place.\n\n```handlebars\n{{#let\n (concat post.title ' | The Ember.js Blog')\n post.content\n (hash\n theme=\"high-contrast\"\n enableComments=true\n )\n as |title content options|\n}}\n <MyPost @title={{title}} @content={{content}} @options={{options}} />\n{{/let}}\n ```\n\n `let` is built-in and does not need to be imported.",
|
|
6933
6933
|
"itemtype": "method",
|
|
6934
6934
|
"name": "let",
|
|
6935
6935
|
"access": "public",
|
|
@@ -6940,7 +6940,7 @@
|
|
|
6940
6940
|
{
|
|
6941
6941
|
"file": "packages/@ember/-internals/glimmer/lib/syntax/mount.ts",
|
|
6942
6942
|
"line": 17,
|
|
6943
|
-
"description": "The `{{mount}}` helper lets you embed a routeless engine in a template.\nMounting an engine will cause an instance to be booted and its `application`\ntemplate to be rendered.\n\nFor example, the following template mounts the `ember-chat` engine:\n\n```
|
|
6943
|
+
"description": "The `{{mount}}` helper lets you embed a routeless engine in a template.\nMounting an engine will cause an instance to be booted and its `application`\ntemplate to be rendered.\n\nFor example, the following template mounts the `ember-chat` engine:\n\n```app/templates/application.gjs\n{{mount \"ember-chat\"}}\n```\n\nAdditionally, you can also pass in a `model` argument that will be\nset as the engines model. This can be an existing object:\n\n```hbs\n<div>\n {{mount 'admin' model=userSettings}}\n</div>\n```\n\nOr an inline `hash`, and you can even pass components:\n\n```gjs\nimport SignInButton from '../components/sign-in-button';\n<template>\n <div>\n <h1>Application template!</h1>\n {{mount 'admin' model=(hash\n title='Secret Admin'\n signInButton=SignInButton\n )}}\n </div>\n</template>\n```\n \n `mount` is built-in and does not need to be imported.",
|
|
6944
6944
|
"itemtype": "method",
|
|
6945
6945
|
"name": "mount",
|
|
6946
6946
|
"params": [
|
|
@@ -6964,7 +6964,7 @@
|
|
|
6964
6964
|
{
|
|
6965
6965
|
"file": "packages/@ember/-internals/glimmer/lib/syntax/outlet.ts",
|
|
6966
6966
|
"line": 28,
|
|
6967
|
-
"description": "The `{{outlet}}` helper lets you specify where a child route will render in\nyour template. An important use of the `{{outlet}}` helper is in your\napplication's `application.
|
|
6967
|
+
"description": "The `{{outlet}}` helper lets you specify where a child route will render in\nyour template. An important use of the `{{outlet}}` helper is in your\napplication's `application.gjs` file:\n\n```app/templates/application.gjs\nimport MyHeader from '../components/my-header';\nimport MyFooter from '../components/my-footer';\n \n<template>\n <MyHeader />\n\n <div class=\"my-dynamic-content\">\n <!-- this content will change based on the current route, which depends on the current URL -->\n {{outlet}}\n </div>\n\n <MyFooter />\n</template>\n```\n\nSee the [routing guide](https://guides.emberjs.com/release/routing/rendering-a-template/) for more\ninformation on how your `route` interacts with the `{{outlet}}` helper.\nNote: Your content __will not render__ if there isn't an `{{outlet}}` for it.\n\n`outlet` is built-in and does not need to be imported.",
|
|
6968
6968
|
"itemtype": "method",
|
|
6969
6969
|
"name": "outlet",
|
|
6970
6970
|
"access": "public",
|
|
@@ -7349,7 +7349,7 @@
|
|
|
7349
7349
|
},
|
|
7350
7350
|
{
|
|
7351
7351
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7352
|
-
"line":
|
|
7352
|
+
"line": 838,
|
|
7353
7353
|
"description": "Standard CSS class names to apply to the view's outer element. This\nproperty automatically inherits any class names defined by the view's\nsuperclasses as well.",
|
|
7354
7354
|
"itemtype": "property",
|
|
7355
7355
|
"name": "classNames",
|
|
@@ -7362,7 +7362,7 @@
|
|
|
7362
7362
|
},
|
|
7363
7363
|
{
|
|
7364
7364
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7365
|
-
"line":
|
|
7365
|
+
"line": 850,
|
|
7366
7366
|
"description": "A list of properties of the view to apply as class names. If the property\nis a string value, the value of that string will be applied as a class\nname.\n\n```javascript\n// Applies the 'high' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n classNameBindings: ['priority'],\n priority: 'high'\n});\n```\n\nIf the value of the property is a Boolean, the name of that property is\nadded as a dasherized class name.\n\n```javascript\n// Applies the 'is-urgent' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n classNameBindings: ['isUrgent'],\n isUrgent: true\n});\n```\n\nIf you would prefer to use a custom value instead of the dasherized\nproperty name, you can pass a binding like this:\n\n```javascript\n// Applies the 'urgent' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n classNameBindings: ['isUrgent:urgent'],\n isUrgent: true\n});\n```\n\nIf you would like to specify a class that should only be added when the\nproperty is false, you can declare a binding like this:\n\n```javascript\n// Applies the 'disabled' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n classNameBindings: ['isEnabled::disabled'],\n isEnabled: false\n});\n```\n\nThis list of properties is inherited from the component's superclasses as well.",
|
|
7367
7367
|
"itemtype": "property",
|
|
7368
7368
|
"name": "classNameBindings",
|
|
@@ -7375,7 +7375,7 @@
|
|
|
7375
7375
|
},
|
|
7376
7376
|
{
|
|
7377
7377
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7378
|
-
"line":
|
|
7378
|
+
"line": 1057,
|
|
7379
7379
|
"description": "Normally, Ember's component model is \"write-only\". The component takes a\nbunch of attributes that it got passed in, and uses them to render its\ntemplate.\n\nOne nice thing about this model is that if you try to set a value to the\nsame thing as last time, Ember (through HTMLBars) will avoid doing any\nwork on the DOM.\n\nThis is not just a performance optimization. If an attribute has not\nchanged, it is important not to clobber the element's \"hidden state\".\nFor example, if you set an input's `value` to the same value as before,\nit will clobber selection state and cursor position. In other words,\nsetting an attribute is not **always** idempotent.\n\nThis method provides a way to read an element's attribute and also\nupdate the last value Ember knows about at the same time. This makes\nsetting an attribute idempotent.\n\nIn particular, what this means is that if you get an `<input>` element's\n`value` attribute and then re-render the template with the same value,\nit will avoid clobbering the cursor and selection position.\nSince most attribute sets are idempotent in the browser, you typically\ncan get away with reading attributes using jQuery, but the most reliable\nway to do so is through this method.",
|
|
7380
7380
|
"itemtype": "method",
|
|
7381
7381
|
"name": "readDOMAttr",
|
|
@@ -7396,7 +7396,7 @@
|
|
|
7396
7396
|
},
|
|
7397
7397
|
{
|
|
7398
7398
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7399
|
-
"line":
|
|
7399
|
+
"line": 1115,
|
|
7400
7400
|
"description": "A list of properties of the view to apply as attributes. If the property\nis a string value, the value of that string will be applied as the value\nfor an attribute of the property's name.\n\nThe following example creates a tag like `<div priority=\"high\" />`.\n\n```app/components/my-component.js\nimport Component from '@ember/component';\n\nexport default Component.extend({\n attributeBindings: ['priority'],\n priority: 'high'\n });\n```\n\nIf the value of the property is a Boolean, the attribute is treated as\nan HTML Boolean attribute. It will be present if the property is `true`\nand omitted if the property is `false`.\n\nThe following example creates markup like `<div visible />`.\n\n```app/components/my-component.js\nimport Component from '@ember/component';\n\nexport default Component.extend({\n attributeBindings: ['visible'],\n visible: true\n });\n```\n\nIf you would prefer to use a custom value instead of the property name,\nyou can create the same markup as the last example with a binding like\nthis:\n\n```app/components/my-component.js\nimport Component from '@ember/component';\n\nexport default Component.extend({\n attributeBindings: ['isVisible:visible'],\n isVisible: true\n });\n```\n\nThis list of attributes is inherited from the component's superclasses,\nas well.",
|
|
7401
7401
|
"itemtype": "property",
|
|
7402
7402
|
"name": "attributeBindings",
|
|
@@ -7409,7 +7409,7 @@
|
|
|
7409
7409
|
},
|
|
7410
7410
|
{
|
|
7411
7411
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7412
|
-
"line":
|
|
7412
|
+
"line": 1169,
|
|
7413
7413
|
"description": "Enables components to take a list of parameters as arguments.\n For example, a component that takes two parameters with the names\n `name` and `age`:\n\n ```app/components/my-component.js\n import Component from '@ember/component';\n\n export default class MyComponent extends Component {\n static positionalParams = ['name', 'age'];\n }\n ```\n\n It can then be invoked like this:\n\n ```hbs\n {{my-component \"John\" 38}}\n ```\n\n The parameters can be referred to just like named parameters:\n\n ```hbs\n Name: {{name}}, Age: {{age}}.\n ```\n\n Using a string instead of an array allows for an arbitrary number of\n parameters:\n\n ```app/components/my-component.js\n import Component from '@ember/component';\n\n export default class MyComponent extends Component {\n static positionalParams = 'names';\n }\n ```\n\n It can then be invoked like this:\n\n ```hbs\n {{my-component \"John\" \"Michael\" \"Scott\"}}\n ```\n The parameters can then be referred to by enumerating over the list:\n\n ```hbs\n {{#each names as |name|}}{{name}}{{/each}}\n ```",
|
|
7414
7414
|
"static": 1,
|
|
7415
7415
|
"access": "public",
|
|
@@ -7422,7 +7422,7 @@
|
|
|
7422
7422
|
},
|
|
7423
7423
|
{
|
|
7424
7424
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7425
|
-
"line":
|
|
7425
|
+
"line": 1274,
|
|
7426
7426
|
"description": "Layout can be used to wrap content in a component.",
|
|
7427
7427
|
"itemtype": "property",
|
|
7428
7428
|
"name": "layout",
|
|
@@ -7434,7 +7434,7 @@
|
|
|
7434
7434
|
},
|
|
7435
7435
|
{
|
|
7436
7436
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7437
|
-
"line":
|
|
7437
|
+
"line": 1282,
|
|
7438
7438
|
"description": "The name of the layout to lookup if no layout is provided.\nBy default `Component` will lookup a template with this name in\n`Ember.TEMPLATES` (a shared global object).",
|
|
7439
7439
|
"itemtype": "property",
|
|
7440
7440
|
"name": "layoutName",
|
|
@@ -7447,7 +7447,7 @@
|
|
|
7447
7447
|
},
|
|
7448
7448
|
{
|
|
7449
7449
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7450
|
-
"line":
|
|
7450
|
+
"line": 1293,
|
|
7451
7451
|
"description": "The WAI-ARIA role of the control represented by this view. For example, a\n button may have a role of type 'button', or a pane may have a role of\n type 'alertdialog'. This property is used by assistive software to help\n visually challenged users navigate rich web applications.\n\n The full list of valid WAI-ARIA roles is available at:\n [https://www.w3.org/TR/wai-aria/#roles_categorization](https://www.w3.org/TR/wai-aria/#roles_categorization)",
|
|
7452
7452
|
"itemtype": "property",
|
|
7453
7453
|
"name": "ariaRole",
|
|
@@ -7460,7 +7460,7 @@
|
|
|
7460
7460
|
},
|
|
7461
7461
|
{
|
|
7462
7462
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7463
|
-
"line":
|
|
7463
|
+
"line": 1309,
|
|
7464
7464
|
"description": "Array of child views. You should never edit this array directly.",
|
|
7465
7465
|
"itemtype": "property",
|
|
7466
7466
|
"name": "childViews",
|
|
@@ -7473,7 +7473,7 @@
|
|
|
7473
7473
|
},
|
|
7474
7474
|
{
|
|
7475
7475
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7476
|
-
"line":
|
|
7476
|
+
"line": 1349,
|
|
7477
7477
|
"description": "Return the nearest ancestor that is an instance of the provided\nclass or mixin.",
|
|
7478
7478
|
"itemtype": "method",
|
|
7479
7479
|
"name": "nearestOfType",
|
|
@@ -7496,7 +7496,7 @@
|
|
|
7496
7496
|
},
|
|
7497
7497
|
{
|
|
7498
7498
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7499
|
-
"line":
|
|
7499
|
+
"line": 1373,
|
|
7500
7500
|
"description": "Return the nearest ancestor that has a given property.",
|
|
7501
7501
|
"itemtype": "method",
|
|
7502
7502
|
"name": "nearestWithProperty",
|
|
@@ -7519,7 +7519,7 @@
|
|
|
7519
7519
|
},
|
|
7520
7520
|
{
|
|
7521
7521
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7522
|
-
"line":
|
|
7522
|
+
"line": 1395,
|
|
7523
7523
|
"description": "Renders the view again. This will work regardless of whether the\nview is already in the DOM or not. If the view is in the DOM, the\nrendering process will be deferred to give bindings a chance\nto synchronize.\n\nIf children were added during the rendering process using `appendChild`,\n`rerender` will remove them, because they will be added again\nif needed by the next `render`.\n\nIn general, if the display of your view changes, you should modify\nthe DOM element directly instead of manually calling `rerender`, which can\nbe slow.",
|
|
7524
7524
|
"itemtype": "method",
|
|
7525
7525
|
"name": "rerender",
|
|
@@ -7530,7 +7530,7 @@
|
|
|
7530
7530
|
},
|
|
7531
7531
|
{
|
|
7532
7532
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7533
|
-
"line":
|
|
7533
|
+
"line": 1420,
|
|
7534
7534
|
"description": "Returns the current DOM element for the view.",
|
|
7535
7535
|
"itemtype": "property",
|
|
7536
7536
|
"name": "element",
|
|
@@ -7542,7 +7542,7 @@
|
|
|
7542
7542
|
},
|
|
7543
7543
|
{
|
|
7544
7544
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7545
|
-
"line":
|
|
7545
|
+
"line": 1433,
|
|
7546
7546
|
"description": "Appends the view's element to the specified parent element.\n\nNote that this method just schedules the view to be appended; the DOM\nelement will not be appended to the given element until all bindings have\nfinished synchronizing.\n\nThis is not typically a function that you will need to call directly when\nbuilding your application. If you do need to use `appendTo`, be sure that\nthe target element you are providing is associated with an `Application`\nand does not have an ancestor element that is associated with an Ember view.",
|
|
7547
7547
|
"itemtype": "method",
|
|
7548
7548
|
"name": "appendTo",
|
|
@@ -7564,7 +7564,7 @@
|
|
|
7564
7564
|
},
|
|
7565
7565
|
{
|
|
7566
7566
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7567
|
-
"line":
|
|
7567
|
+
"line": 1498,
|
|
7568
7568
|
"description": "Appends the view's element to the document body. If the view does\nnot have an HTML representation yet\nthe element will be generated automatically.\n\nIf your application uses the `rootElement` property, you must append\nthe view within that element. Rendering views outside of the `rootElement`\nis not supported.\n\nNote that this method just schedules the view to be appended; the DOM\nelement will not be appended to the document body until all bindings have\nfinished synchronizing.",
|
|
7569
7569
|
"itemtype": "method",
|
|
7570
7570
|
"name": "append",
|
|
@@ -7579,7 +7579,7 @@
|
|
|
7579
7579
|
},
|
|
7580
7580
|
{
|
|
7581
7581
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7582
|
-
"line":
|
|
7582
|
+
"line": 1519,
|
|
7583
7583
|
"description": "The HTML `id` of the view's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):\n\n```handlebars\n{{my-component elementId=\"a-really-cool-id\"}}\n```\n\nIf not manually set a default value will be provided by the framework.\n\nOnce rendered an element's `elementId` is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\n`elementId`, you should do this when the component or element is being\ninstantiated:\n\n```app/components/my-component.js\nimport Component from '@ember/component';\n\nexport default Component.extend({\n init() {\n this._super(...arguments);\n let index = this.get('index');\n this.set('elementId', 'component-id' + index);\n }\n });\n```",
|
|
7584
7584
|
"itemtype": "property",
|
|
7585
7585
|
"name": "elementId",
|
|
@@ -7591,7 +7591,7 @@
|
|
|
7591
7591
|
},
|
|
7592
7592
|
{
|
|
7593
7593
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7594
|
-
"line":
|
|
7594
|
+
"line": 1552,
|
|
7595
7595
|
"description": "Called when a view is going to insert an element into the DOM.",
|
|
7596
7596
|
"itemtype": "event",
|
|
7597
7597
|
"name": "willInsertElement",
|
|
@@ -7602,7 +7602,7 @@
|
|
|
7602
7602
|
},
|
|
7603
7603
|
{
|
|
7604
7604
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7605
|
-
"line":
|
|
7605
|
+
"line": 1562,
|
|
7606
7606
|
"description": "Called when the element of the view has been inserted into the DOM.\nOverride this function to do any set up that requires an element\nin the document body.\n\nWhen a view has children, didInsertElement will be called on the\nchild view(s) first and on itself afterwards.",
|
|
7607
7607
|
"itemtype": "event",
|
|
7608
7608
|
"name": "didInsertElement",
|
|
@@ -7613,7 +7613,7 @@
|
|
|
7613
7613
|
},
|
|
7614
7614
|
{
|
|
7615
7615
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7616
|
-
"line":
|
|
7616
|
+
"line": 1577,
|
|
7617
7617
|
"description": "Called when the view is about to rerender, but before anything has\nbeen torn down. This is a good opportunity to tear down any manual\nobservers you have installed based on the DOM state",
|
|
7618
7618
|
"itemtype": "event",
|
|
7619
7619
|
"name": "willClearRender",
|
|
@@ -7624,7 +7624,7 @@
|
|
|
7624
7624
|
},
|
|
7625
7625
|
{
|
|
7626
7626
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7627
|
-
"line":
|
|
7627
|
+
"line": 1589,
|
|
7628
7628
|
"description": "You must call `destroy` on a view to destroy the view (and all of its\nchild views). This will remove the view from any parent node, then make\nsure that the DOM element managed by the view can be released by the\nmemory manager.",
|
|
7629
7629
|
"itemtype": "method",
|
|
7630
7630
|
"name": "destroy",
|
|
@@ -7635,7 +7635,7 @@
|
|
|
7635
7635
|
},
|
|
7636
7636
|
{
|
|
7637
7637
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7638
|
-
"line":
|
|
7638
|
+
"line": 1604,
|
|
7639
7639
|
"description": "Called when the element of the view is going to be destroyed. Override\nthis function to do any teardown that requires an element, like removing\nevent listeners.\n\nPlease note: any property changes made during this event will have no\neffect on object observers.",
|
|
7640
7640
|
"itemtype": "event",
|
|
7641
7641
|
"name": "willDestroyElement",
|
|
@@ -7646,7 +7646,7 @@
|
|
|
7646
7646
|
},
|
|
7647
7647
|
{
|
|
7648
7648
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7649
|
-
"line":
|
|
7649
|
+
"line": 1619,
|
|
7650
7650
|
"description": "Called after the element of the view is destroyed.",
|
|
7651
7651
|
"itemtype": "event",
|
|
7652
7652
|
"name": "willDestroyElement",
|
|
@@ -7657,7 +7657,7 @@
|
|
|
7657
7657
|
},
|
|
7658
7658
|
{
|
|
7659
7659
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7660
|
-
"line":
|
|
7660
|
+
"line": 1629,
|
|
7661
7661
|
"description": "Called when the parentView property has changed.",
|
|
7662
7662
|
"itemtype": "event",
|
|
7663
7663
|
"name": "parentViewDidChange",
|
|
@@ -7668,7 +7668,7 @@
|
|
|
7668
7668
|
},
|
|
7669
7669
|
{
|
|
7670
7670
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7671
|
-
"line":
|
|
7671
|
+
"line": 1643,
|
|
7672
7672
|
"description": "Tag name for the view's outer element. The tag name is only used when an\nelement is first created. If you change the `tagName` for an element, you\nmust destroy and recreate the view element.\n\nBy default, the render buffer will use a `<div>` tag for views.\n\nIf the tagName is `''`, the view will be tagless, with no outer element.\nComponent properties that depend on the presence of an outer element, such\nas `classNameBindings` and `attributeBindings`, do not work with tagless\ncomponents. Tagless components cannot implement methods to handle events,\nand their `element` property has a `null` value.",
|
|
7673
7673
|
"itemtype": "property",
|
|
7674
7674
|
"name": "tagName",
|
|
@@ -7681,7 +7681,7 @@
|
|
|
7681
7681
|
},
|
|
7682
7682
|
{
|
|
7683
7683
|
"file": "packages/@ember/-internals/glimmer/lib/component.ts",
|
|
7684
|
-
"line":
|
|
7684
|
+
"line": 1670,
|
|
7685
7685
|
"description": "Handle events from `EventDispatcher`",
|
|
7686
7686
|
"itemtype": "method",
|
|
7687
7687
|
"name": "handleEvent",
|
|
@@ -7705,7 +7705,7 @@
|
|
|
7705
7705
|
{
|
|
7706
7706
|
"file": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts",
|
|
7707
7707
|
"line": 22,
|
|
7708
|
-
"description": "Marks a property as tracked. By default, values that are rendered in Ember app\ntemplates are _static_, meaning that updates to them won't cause the\napplication to rerender. Marking a property as tracked means that when that\nproperty changes, any templates that used that property, directly or\nindirectly, will rerender. For instance, consider this component:\n\n```
|
|
7708
|
+
"description": "Marks a property as tracked. By default, values that are rendered in Ember app\ntemplates are _static_, meaning that updates to them won't cause the\napplication to rerender. Marking a property as tracked means that when that\nproperty changes, any templates that used that property, directly or\nindirectly, will rerender. For instance, consider this component:\n\n```gjs\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\n\nexport default class CounterComponent extends Component {\n @tracked count = 0;\n\n get timesTen() {\n return this.count * 10;\n }\n\n @action\n plusOne() {\n this.count += 1;\n }\n \n <template>\n <div>Count: {{this.count}}</div>\n <div>Times Ten: {{this.timesTen}}</div>\n <div>\n <button {{on \"click\" this.plusOne}}>\n Plus One\n </button>\n </div>\n </template>\n}\n```\n\nBoth the `{{this.count}}` and the `{{this.timesTen}}` properties in the\ntemplate will update whenever the button is clicked. Any tracked properties\nthat are used in any way to calculate a value that is used in the template\nwill cause a rerender when updated - this includes through method calls and\nother means:\n\n```gjs\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nclass Entry {\n @tracked name;\n @tracked phoneNumber;\n\n constructor(name, phoneNumber) {\n this.name = name;\n this.phoneNumber = phoneNumber;\n }\n}\n\nexport default class PhoneBookComponent extends Component {\n entries = [\n new Entry('Pizza Palace', 5551234),\n new Entry('1st Street Cleaners', 5554321),\n new Entry('Plants R Us', 5552468),\n ];\n\n // Any usage of this property will update whenever any of the names in the\n // entries arrays are updated\n get names() {\n return this.entries.map(e => e.name);\n }\n\n // Any usage of this property will update whenever any of the numbers in the\n // entries arrays are updated\n get numbers() {\n return this.getFormattedNumbers();\n }\n\n getFormattedNumbers() {\n return this.entries\n .map(e => e.phoneNumber)\n .map(number => {\n let numberString = '' + number;\n\n return numberString.slice(0, 3) + '-' + numberString.slice(3);\n });\n }\n}\n```\n\nIt's important to note that setting tracked properties will always trigger an\nupdate, even if the property is set to the same value as it was before.\n\n```js\nlet entry = new Entry('Pizza Palace', 5551234);\n\n// if entry was used when rendering, this would cause a rerender, even though\n// the name is being set to the same value as it was before\nentry.name = entry.name;\n```\n\n`tracked` can also be used with the classic Ember object model in a similar\nmanner to classic computed properties:\n\n```javascript\nimport EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n name: tracked(),\n phoneNumber: tracked()\n});\n```\n\nOften this is unnecessary, but to ensure robust auto-tracking behavior it is\nadvisable to mark tracked state appropriately wherever possible.\n\nThis form of `tracked` also accepts an optional configuration object\ncontaining either an initial `value` or an `initializer` function (but not\nboth).\n\n```javascript\nimport EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n name: tracked({ value: 'Zoey' }),\n favoriteSongs: tracked({\n initializer: () => ['Raspberry Beret', 'Time After Time']\n })\n});\n```",
|
|
7709
7709
|
"itemtype": "method",
|
|
7710
7710
|
"name": "tracked",
|
|
7711
7711
|
"static": 1,
|
|
@@ -7728,7 +7728,7 @@
|
|
|
7728
7728
|
},
|
|
7729
7729
|
{
|
|
7730
7730
|
"file": "packages/@ember/-internals/glimmer/lib/helper.ts",
|
|
7731
|
-
"line":
|
|
7731
|
+
"line": 117,
|
|
7732
7732
|
"description": "Override this function when writing a class-based helper.",
|
|
7733
7733
|
"itemtype": "method",
|
|
7734
7734
|
"name": "compute",
|
|
@@ -7752,13 +7752,13 @@
|
|
|
7752
7752
|
},
|
|
7753
7753
|
{
|
|
7754
7754
|
"file": "packages/@ember/-internals/glimmer/lib/helper.ts",
|
|
7755
|
-
"line":
|
|
7755
|
+
"line": 135,
|
|
7756
7756
|
"class": "Helper",
|
|
7757
7757
|
"module": "@ember/component"
|
|
7758
7758
|
},
|
|
7759
7759
|
{
|
|
7760
7760
|
"file": "packages/@ember/-internals/glimmer/lib/helper.ts",
|
|
7761
|
-
"line":
|
|
7761
|
+
"line": 154,
|
|
7762
7762
|
"description": "On a class-based helper, it may be useful to force a recomputation of that\nhelpers value. This is akin to `rerender` on a component.\n\nIn most cases, `recompute` is not needed because accessing tracked\nproperties in `compute` will automatically re-run the helper when\nthose properties change. Use `recompute` only when you need to\ntrigger a recomputation imperatively, for example in response to an\nexternal event:\n\n```app/helpers/current-time.js\nimport Helper from '@ember/component/helper';\n\nexport default class CurrentTimeHelper extends Helper {\n interval = null;\n\n compute() {\n return new Date().toLocaleTimeString();\n }\n\n constructor() {\n super(...arguments);\n this.interval = setInterval(() => this.recompute(), 1000);\n }\n\n willDestroy() {\n super.willDestroy();\n clearInterval(this.interval);\n }\n}\n```",
|
|
7763
7763
|
"itemtype": "method",
|
|
7764
7764
|
"name": "recompute",
|
|
@@ -7770,7 +7770,7 @@
|
|
|
7770
7770
|
},
|
|
7771
7771
|
{
|
|
7772
7772
|
"file": "packages/@ember/-internals/glimmer/lib/helper.ts",
|
|
7773
|
-
"line":
|
|
7773
|
+
"line": 325,
|
|
7774
7774
|
"description": "The type of a function-based helper.",
|
|
7775
7775
|
"note": "This is *not* user-constructible: it is exported only so that the type\n returned by the `helper` function can be named (and indeed can be exported\n like `export default helper(...)` safely).",
|
|
7776
7776
|
"class": "Helper",
|
|
@@ -7778,7 +7778,7 @@
|
|
|
7778
7778
|
},
|
|
7779
7779
|
{
|
|
7780
7780
|
"file": "packages/@ember/-internals/glimmer/lib/helper.ts",
|
|
7781
|
-
"line":
|
|
7781
|
+
"line": 356,
|
|
7782
7782
|
"description": "In many cases it is not necessary to use the full `Helper` class.\nThe `helper` method create pure-function helpers without instances.\nFor example:\n\n```app/helpers/format-currency.js\nimport { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n return `${currency}${cents * 0.01}`;\n});\n```",
|
|
7783
7783
|
"static": 1,
|
|
7784
7784
|
"params": [
|
|
@@ -7998,8 +7998,8 @@
|
|
|
7998
7998
|
},
|
|
7999
7999
|
{
|
|
8000
8000
|
"file": "packages/@ember/-internals/glimmer/index.ts",
|
|
8001
|
-
"line":
|
|
8002
|
-
"description": "`{{yield}}` denotes an area of a template that will be rendered inside\nof another template.\n\n### Use with `Component`\n\nWhen designing components `{{yield}}` is used to denote where, inside the component's\ntemplate, an optional block passed to the component should render:\n\n```app/templates/application.
|
|
8001
|
+
"line": 109,
|
|
8002
|
+
"description": "`{{yield}}` denotes an area of a template that will be rendered inside\nof another template.\n\n### Use with `Component`\n\nWhen designing components `{{yield}}` is used to denote where, inside the component's\ntemplate, an optional block passed to the component should render:\n\n```app/templates/application.gjs\nimport LabeledTextField from '../components/labeled-textfield';\n \n<template>\n <LabeledTextField @value={{@model.name}}>\n First name:\n </LabeledTextField>\n</template>\n```\n\n```app/components/labeled-textfield.gjs\nimport { Input } from '@ember/component';\n \n<template>\n <label>\n {{yield}} <Input @value={{@value}} />\n </label>\n</template>\n```\n\nResult:\n\n```html\n<label>\n First name: <input type=\"text\" />\n</label>\n```\n\nAdditionally you can `yield` properties into the context for use by the consumer:\n\n```app/templates/application.gjs\nimport Component from '@glimmer/component';\nimport LabeledTextField from '../components/labeled-textfield';\n \nexport default class Application extends Component {\n firstNameValidator = (value) => {\n // validates\n }\n \n <template>\n <LabeledTextField @value={{@model.validation}} @validator={{this.firstNameValidator}} as |validationError|>\n {{#if validationError}}\n <p class=\"error\">{{validationError}}</p>\n {{/if}}\n First name:\n </LabeledTextField>\n </template>\n}\n```\n\n```app/components/labeled-textfield.gjs\nimport { Input } from '@ember/component';\n \n<template>\n <label>\n {{yield this.validationError}} <Input @value={{@value}} />\n </label>\n</template>\n```\n\nResult:\n\n```html\n<label>\n <p class=\"error\">First Name must be at least 3 characters long.</p>\n First name: <input type=\"text\" />\n</label>\n```\n\n`yield` can also be used with the `hash` helper:\n\n```app/templates/application.gjs\nimport DateRanges from '../components/date-ranges';\n \n<template>\n <DateRanges @value={{@model.date}} as |range|>\n Start date: {{range.start}}\n End date: {{range.end}}\n </DateRanges>\n</template>\n```\n\n```app/components/date-ranges.gjs\n<template>\n <div>\n {{yield (hash start=@value.start end=@value.end)}}\n </div>\n</template>\n```\n\nResult:\n\n```html\n<div>\n Start date: July 1st\n End date: July 30th\n</div>\n```\n\nMultiple values can be yielded as block params:\n \n```app/templates/application.gjs\nimport Banner from '../components/banner';\n \n<template>\n <Banner @value={{@model}} as |title subtitle body|>\n <h1>{{title}}</h1>\n <h2>{{subtitle}}</h2>\n {{body}}\n </Banner>\n</template>\n```\n\n```app/components/banner.gjs\n<template>\n <div>\n {{yield \"Hello title\" \"hello subtitle\" \"body text\"}}\n </div>\n</template>\n```\n\nResult:\n\n```html\n<div>\n <h1>Hello title</h1>\n <h2>hello subtitle</h2>\n body text\n</div>\n```\n\nHowever, it is preferred to use the hash helper, as this can prevent breaking changes to your component and also simplify the api for the component.\n\nMultiple components can be yielded with the `hash` and `component` helper:\n\n```app/templates/application.gjs\nimport Banner from '../components/banner';\n\n<template>\n <Banner @value={{@model}} as |banner|>\n <banner.Title>Banner title</banner.Title>\n <banner.Subtitle>Banner subtitle</banner.Subtitle>\n <banner.Body>A load of body text</banner.Body>\n </Banner>\n</template>\n```\n\n```app/components/banner.gjs\nimport Title from './banner/title';\nimport Subtitle from './banner/subtitle';\nimport Body from './banner/body';\n\nexport default class Banner extends Component {\n Title = Title;\n Subtitle = Subtitle;\n Body = Body;\n \n <template>\n <div>\n {{yield (hash\n Title=this.Title\n Subtitle=this.Subtitle\n Body=(component this.Body defaultArg=\"some value\")\n )}}\n </div>\n </template>\n}\n```\n\nResult:\n\n```html\n<div>\n <h1>Banner title</h1>\n <h2>Banner subtitle</h2>\n A load of body text\n</div>\n```\n\nA benefit of using this pattern is that the user of the component can change the order the components are displayed.\n\n```app/templates/application.gjs\nimport Banner from '../components/banner';\n\n<template>\n <Banner @value={{@model}} as |banner|>\n <banner.Subtitle>Banner subtitle</banner.Subtitle>\n <banner.Title>Banner title</banner.Title>\n <banner.Body>A load of body text</banner.Body>\n </Banner>\n</template>\n```\n\nResult:\n\n```html\n<div>\n <h2>Banner subtitle</h2>\n <h1>Banner title</h1>\n A load of body text\n</div>\n```\n\nAnother benefit to using `yield` with the `hash` and `component` helper\nis you can pass attributes and arguments to these components:\n\n```app/templates/application.gjs\nimport Banner from '../components/banner';\n\n<template>\n <Banner @value={{@model}} as |banner|>\n <banner.Subtitle class=\"mb-1\">Banner subtitle</banner.Subtitle>\n <banner.Title @variant=\"loud\">Banner title</banner.Title>\n <banner.Body>A load of body text</banner.Body>\n </Banner>\n</template>\n```\n\n```app/components/banner/subtitle.gjs\n{{!-- note the use of ..attributes --}}\n<h2 ...attributes>\n {{yield}}\n</h2>\n```\n\n```app/components/banner/title.gjs\n<template>\n {{#if (eq @variant \"loud\")}}\n <h1 class=\"loud\">{{yield}}</h1>\n {{else}}\n <h1 class=\"quiet\">{{yield}}</h1>\n {{/if}}\n</template>\n```\n\nResult:\n\n```html\n<div>\n <h2 class=\"mb-1\">Banner subtitle</h2>\n <h1 class=\"loud\">Banner title</h1>\n A load of body text\n</div>\n```",
|
|
8003
8003
|
"itemtype": "method",
|
|
8004
8004
|
"name": "yield",
|
|
8005
8005
|
"params": [
|
|
@@ -8020,8 +8020,8 @@
|
|
|
8020
8020
|
},
|
|
8021
8021
|
{
|
|
8022
8022
|
"file": "packages/@ember/-internals/glimmer/index.ts",
|
|
8023
|
-
"line":
|
|
8024
|
-
"description": "`{{(has-block)}}` indicates if the component was invoked with a block.\n\nThis component is invoked with a block:\n\n```handlebars\n
|
|
8023
|
+
"line": 370,
|
|
8024
|
+
"description": "`{{(has-block)}}` indicates if the component was invoked with a block.\n\nThis component is invoked with a block:\n\n```handlebars\n<MyComponent>\n Hi Jen!\n</MyComponent>\n```\n\nThis component is invoked without a block:\n\n```handlebars\n<MyComponent />\n```\n\nThis is useful when you want to create a component that can optionally take a block\nand then render a default template when it is not invoked with a block.\n\n```app/components/my-component.gjs\n<template>\n {{#if (has-block)}}\n Welcome {{yield}}, we are happy you're here!\n {{else}}\n Hey you! You're great!\n {{/if}}\n</template>\n```",
|
|
8025
8025
|
"itemtype": "method",
|
|
8026
8026
|
"name": "has-block",
|
|
8027
8027
|
"params": [
|
|
@@ -8042,8 +8042,8 @@
|
|
|
8042
8042
|
},
|
|
8043
8043
|
{
|
|
8044
8044
|
"file": "packages/@ember/-internals/glimmer/index.ts",
|
|
8045
|
-
"line":
|
|
8046
|
-
"description": "`{{(has-block-params)}}` indicates if the component was invoked with block params.\n\nThis component is invoked with block params:\n
|
|
8045
|
+
"line": 407,
|
|
8046
|
+
"description": "`{{(has-block-params)}}` indicates if the component was invoked with block params.\n\nThis component is invoked with block params:\n \n```handlebars\n<MyComponent as |favoriteFlavor|>\nHi Jen!\n</MyComponent>\n```\n\nAnd without block params:\n\n```handlebars\n<MyComponent>\nHi Jen!\n</MyComponent>\n```\n\nThis is useful when you want to create a component that can render itself\ndifferently when it is not invoked with block params.\n\n```app/components/my-component.gjs\n<template>\n {{#if (has-block-params)}}\n Welcome {{yield this.favoriteFlavor}}, we're happy you're here and hope you\n enjoy your favorite ice cream flavor.\n {{else}}\n Welcome {{yield}}, we're happy you're here, but we're unsure what\n flavor ice cream you would enjoy.\n {{/if}}\n</template>\n```",
|
|
8047
8047
|
"itemtype": "method",
|
|
8048
8048
|
"name": "has-block-params",
|
|
8049
8049
|
"params": [
|
|
@@ -8064,7 +8064,7 @@
|
|
|
8064
8064
|
},
|
|
8065
8065
|
{
|
|
8066
8066
|
"file": "packages/@ember/-internals/glimmer/index.ts",
|
|
8067
|
-
"line":
|
|
8067
|
+
"line": 448,
|
|
8068
8068
|
"description": "Execute the `debugger` statement in the current template's context.\n\n```handlebars\n{{debugger}}\n```\n\nWhen using the debugger helper you will have access to a `get` function. This\nfunction retrieves values available in the context of the template.\nFor example, if you're wondering why a value `{{foo}}` isn't rendering as\nexpected within a template, you could place a `{{debugger}}` statement and,\nwhen the `debugger;` breakpoint is hit, you can attempt to retrieve this value:\n\n```\n> get('foo')\n```\n\n`get` is also aware of keywords. So in this situation\n\n```handlebars\n{{#each this.items as |item|}}\n {{debugger}}\n{{/each}}\n```\n\nYou'll be able to get values from the current item:\n\n```\n> get('item.name')\n```\n\nYou can also access the context of the view to make sure it is the object that\nyou expect:\n\n```\n> context\n```",
|
|
8069
8069
|
"itemtype": "method",
|
|
8070
8070
|
"name": "debugger",
|
|
@@ -12043,7 +12043,7 @@
|
|
|
12043
12043
|
{
|
|
12044
12044
|
"file": "packages/@ember/array/index.ts",
|
|
12045
12045
|
"line": 1870,
|
|
12046
|
-
"description": "Creates an `NativeArray` from an Array-like object.\nDoes not modify the original object's contents.\n\nExample\n\n```app/components/my-component.js\nimport Component from '@ember/component';\nimport { A } from '@ember/array';\n\nexport default Component.extend({\n tagName: 'ul',\n classNames: ['pagination'],\n\n init() {\n this._super(...arguments);\n\n if (!this.get('content')) {\n this.set('content', A());\n this.set('otherContent', A([1,2,3]));\n }\n }\n});\n```",
|
|
12046
|
+
"description": "Creates an `NativeArray` from an Array-like object.\nDoes not modify the original object's contents.\n \nThis exists primarily for historic reasons and should not be used\nin new code. Prefer native [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)\nor [trackedArray](/ember/release/functions/@ember%2Freactive%2Fcollections/trackedArray).\n\nExample\n\n```app/components/my-component.js\nimport Component from '@ember/component';\nimport { A } from '@ember/array';\n\nexport default Component.extend({\n tagName: 'ul',\n classNames: ['pagination'],\n\n init() {\n this._super(...arguments);\n\n if (!this.get('content')) {\n this.set('content', A());\n this.set('otherContent', A([1,2,3]));\n }\n }\n});\n```",
|
|
12047
12047
|
"itemtype": "method",
|
|
12048
12048
|
"name": "A",
|
|
12049
12049
|
"static": 1,
|
|
@@ -12058,70 +12058,70 @@
|
|
|
12058
12058
|
},
|
|
12059
12059
|
{
|
|
12060
12060
|
"file": "packages/@ember/array/index.ts",
|
|
12061
|
-
"line":
|
|
12061
|
+
"line": 1915,
|
|
12062
12062
|
"description": "The final definition of NativeArray removes all native methods. This is the list of removed methods\nwhen run in Chrome 106.",
|
|
12063
12063
|
"class": "@ember/array",
|
|
12064
12064
|
"module": "ember"
|
|
12065
12065
|
},
|
|
12066
12066
|
{
|
|
12067
12067
|
"file": "packages/@ember/array/index.ts",
|
|
12068
|
-
"line":
|
|
12068
|
+
"line": 1932,
|
|
12069
12069
|
"description": "These additional items must be redefined since `Omit` causes methods that return `this` to return the\ntype at the time of the Omit.",
|
|
12070
12070
|
"class": "@ember/array",
|
|
12071
12071
|
"module": "ember"
|
|
12072
12072
|
},
|
|
12073
12073
|
{
|
|
12074
12074
|
"file": "packages/@ember/array/index.ts",
|
|
12075
|
-
"line":
|
|
12075
|
+
"line": 1956,
|
|
12076
12076
|
"description": "Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.",
|
|
12077
12077
|
"class": "@ember/array",
|
|
12078
12078
|
"module": "ember"
|
|
12079
12079
|
},
|
|
12080
12080
|
{
|
|
12081
12081
|
"file": "packages/@ember/array/index.ts",
|
|
12082
|
-
"line":
|
|
12082
|
+
"line": 1961,
|
|
12083
12083
|
"description": "This will use the primitive `replace()` method to insert an object at the\nspecified index.",
|
|
12084
12084
|
"class": "@ember/array",
|
|
12085
12085
|
"module": "ember"
|
|
12086
12086
|
},
|
|
12087
12087
|
{
|
|
12088
12088
|
"file": "packages/@ember/array/index.ts",
|
|
12089
|
-
"line":
|
|
12089
|
+
"line": 1966,
|
|
12090
12090
|
"description": "Remove an object at the specified index using the `replace()` primitive\nmethod. You can pass either a single index, or a start and a length.",
|
|
12091
12091
|
"class": "@ember/array",
|
|
12092
12092
|
"module": "ember"
|
|
12093
12093
|
},
|
|
12094
12094
|
{
|
|
12095
12095
|
"file": "packages/@ember/array/index.ts",
|
|
12096
|
-
"line":
|
|
12096
|
+
"line": 1971,
|
|
12097
12097
|
"description": "Add the objects in the passed numerable to the end of the array. Defers\nnotifying observers of the change until all objects are added.",
|
|
12098
12098
|
"class": "@ember/array",
|
|
12099
12099
|
"module": "ember"
|
|
12100
12100
|
},
|
|
12101
12101
|
{
|
|
12102
12102
|
"file": "packages/@ember/array/index.ts",
|
|
12103
|
-
"line":
|
|
12103
|
+
"line": 1976,
|
|
12104
12104
|
"description": "Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.",
|
|
12105
12105
|
"class": "@ember/array",
|
|
12106
12106
|
"module": "ember"
|
|
12107
12107
|
},
|
|
12108
12108
|
{
|
|
12109
12109
|
"file": "packages/@ember/array/index.ts",
|
|
12110
|
-
"line":
|
|
12110
|
+
"line": 1981,
|
|
12111
12111
|
"description": "Reverse objects in the array. Works just like `reverse()` but it is\nKVO-compliant.",
|
|
12112
12112
|
"class": "@ember/array",
|
|
12113
12113
|
"module": "ember"
|
|
12114
12114
|
},
|
|
12115
12115
|
{
|
|
12116
12116
|
"file": "packages/@ember/array/index.ts",
|
|
12117
|
-
"line":
|
|
12117
|
+
"line": 1986,
|
|
12118
12118
|
"description": "Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.",
|
|
12119
12119
|
"class": "@ember/array",
|
|
12120
12120
|
"module": "ember"
|
|
12121
12121
|
},
|
|
12122
12122
|
{
|
|
12123
12123
|
"file": "packages/@ember/array/index.ts",
|
|
12124
|
-
"line":
|
|
12124
|
+
"line": 1991,
|
|
12125
12125
|
"description": "Remove all occurrences of an object in the array.\n\n```javascript\nlet cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago'); // ['Berlin', 'Lima']\ncities.removeObject('Lima'); // ['Berlin']\ncities.removeObject('Tokyo') // ['Berlin']\n```",
|
|
12126
12126
|
"itemtype": "method",
|
|
12127
12127
|
"name": "removeObject",
|
|
@@ -12143,14 +12143,14 @@
|
|
|
12143
12143
|
},
|
|
12144
12144
|
{
|
|
12145
12145
|
"file": "packages/@ember/array/index.ts",
|
|
12146
|
-
"line":
|
|
12146
|
+
"line": 2008,
|
|
12147
12147
|
"description": "Removes each object in the passed array from the receiver.",
|
|
12148
12148
|
"class": "@ember/array",
|
|
12149
12149
|
"module": "ember"
|
|
12150
12150
|
},
|
|
12151
12151
|
{
|
|
12152
12152
|
"file": "packages/@ember/array/index.ts",
|
|
12153
|
-
"line":
|
|
12153
|
+
"line": 2012,
|
|
12154
12154
|
"description": "Push the object onto the end of the array if it is not already\npresent in the array.\n\n```javascript\nlet cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima'); // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin'); // ['Chicago', 'Berlin', 'Lima']\n```",
|
|
12155
12155
|
"itemtype": "method",
|
|
12156
12156
|
"name": "addObject",
|
|
@@ -12172,14 +12172,14 @@
|
|
|
12172
12172
|
},
|
|
12173
12173
|
{
|
|
12174
12174
|
"file": "packages/@ember/array/index.ts",
|
|
12175
|
-
"line":
|
|
12175
|
+
"line": 2029,
|
|
12176
12176
|
"description": "Adds each object in the passed enumerable to the receiver.",
|
|
12177
12177
|
"class": "@ember/array",
|
|
12178
12178
|
"module": "ember"
|
|
12179
12179
|
},
|
|
12180
12180
|
{
|
|
12181
12181
|
"file": "packages/@ember/array/index.ts",
|
|
12182
|
-
"line":
|
|
12182
|
+
"line": 2033,
|
|
12183
12183
|
"description": "Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to `set(),` otherwise\nit will be set directly. `null` objects are skipped.\n\n```javascript\nlet people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];\n```",
|
|
12184
12184
|
"itemtype": "method",
|
|
12185
12185
|
"name": "setEach",
|
|
@@ -12206,7 +12206,7 @@
|
|
|
12206
12206
|
},
|
|
12207
12207
|
{
|
|
12208
12208
|
"file": "packages/@ember/array/index.ts",
|
|
12209
|
-
"line":
|
|
12209
|
+
"line": 2053,
|
|
12210
12210
|
"description": "This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.\n\n```javascript\nlet peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']\n```",
|
|
12211
12211
|
"itemtype": "property",
|
|
12212
12212
|
"name": "[]",
|
|
@@ -12522,7 +12522,7 @@
|
|
|
12522
12522
|
{
|
|
12523
12523
|
"file": "packages/@ember/controller/index.ts",
|
|
12524
12524
|
"line": 39,
|
|
12525
|
-
"description": "The object to which actions from the view should be sent.\n\nFor example, when a
|
|
12525
|
+
"description": "The object to which actions from the view should be sent.\n\nFor example, when a template uses the `{{action}}` helper,\nit will attempt to send the action to the view's controller's `target`.\n\nBy default, the value of the target property is set to the router, and\nis injected when a controller is instantiated. This injection is applied\nas part of the application's initialization process. In most cases the\n`target` property will automatically be set to the logical consumer of\nactions for the controller.",
|
|
12526
12526
|
"itemtype": "property",
|
|
12527
12527
|
"name": "target",
|
|
12528
12528
|
"default": "null",
|
|
@@ -14045,41 +14045,41 @@
|
|
|
14045
14045
|
{
|
|
14046
14046
|
"file": "packages/@ember/helper/index.ts",
|
|
14047
14047
|
"line": 346,
|
|
14048
|
-
"description": "Using the `{{hash}}` helper, you can pass objects directly from the template\nas an argument to your components.\n\n```\
|
|
14048
|
+
"description": "Using the `{{hash}}` helper, you can pass objects directly from the template\nas an argument to your components.\n\n```\n<template>\n {{#each-in (hash givenName='Jen' familyName='Weber') as |key value|}}\n <p>{{key}}: {{value}}</p>\n {{/each-in}}\n</template>\n```",
|
|
14049
14049
|
"class": "@ember/helper",
|
|
14050
14050
|
"module": "@ember/helper"
|
|
14051
14051
|
},
|
|
14052
14052
|
{
|
|
14053
14053
|
"file": "packages/@ember/helper/index.ts",
|
|
14054
|
-
"line":
|
|
14055
|
-
"description": "Using the `{{array}}` helper, you can pass arrays directly from the template\nas an argument to your components.\n\n```js\
|
|
14054
|
+
"line": 361,
|
|
14055
|
+
"description": "Using the `{{array}}` helper, you can pass arrays directly from the template\nas an argument to your components.\n\n```js\n\n<template>\n <ul>\n {{#each (array 'Tom Dale' 'Yehuda Katz' @anotherPerson) as |person|}}\n <li>{{person}}</li>\n {{/each}}\n </ul>\n</template>\n```",
|
|
14056
14056
|
"class": "@ember/helper",
|
|
14057
14057
|
"module": "@ember/helper"
|
|
14058
14058
|
},
|
|
14059
14059
|
{
|
|
14060
14060
|
"file": "packages/@ember/helper/index.ts",
|
|
14061
|
-
"line":
|
|
14062
|
-
"description": "The `{{concat}}` helper makes it easy to dynamically send a number of\nparameters to a component or helper as a single parameter in the format of a\nconcatenated string.\n\nFor example:\n\n```js\nimport { concat } from '@ember/helper';\n\n<template>\n {{get @foo (concat \"item\" @index)}}\n</template>\n```\n\nThis will display the result of `@foo.item1` when `index` is `1`, and\n`this.foo.item2` when `index` is `2`, etc
|
|
14061
|
+
"line": 379,
|
|
14062
|
+
"description": "The `{{concat}}` helper makes it easy to dynamically send a number of\nparameters to a component or helper as a single parameter in the format of a\nconcatenated string.\n\nFor example:\n\n```js\nimport { concat } from '@ember/helper';\n\n<template>\n {{get @foo (concat \"item\" @index)}}\n</template>\n```\n\nThis will display the result of `@foo.item1` when `index` is `1`, and\n`this.foo.item2` when `index` is `2`, etc.",
|
|
14063
14063
|
"class": "@ember/helper",
|
|
14064
14064
|
"module": "@ember/helper"
|
|
14065
14065
|
},
|
|
14066
14066
|
{
|
|
14067
14067
|
"file": "packages/@ember/helper/index.ts",
|
|
14068
|
-
"line":
|
|
14069
|
-
"description": "The `{{get}}` helper makes it easy to dynamically look up a property on an\nobject or an element in an array. The second argument to `{{get}}` can be a\nstring or a number, depending on the object being accessed.\n\nTo access a property on an object with a string key:\n\n```js\nimport { get } from '@ember/helper';\n\n<template>\n {{get @someObject \"objectKey\"}}\n</template>\n```\n\nTo access the first element in an array:\n\n```js\nimport { get } from '@ember/helper';\n\n<template>\n {{get @someArray 0}}\n</template>\n```\n\nTo access a property on an object with a dynamic key:\n\n```js\nimport { get } from '@ember/helper';\n\n<template>\n {{get @address @field}}\n</template>\n```\n\nThis will display the result of `@foo.item1` when `index` is `1`, and\n`this.foo.item2` when `index` is `2`, etc
|
|
14068
|
+
"line": 400,
|
|
14069
|
+
"description": "The `{{get}}` helper makes it easy to dynamically look up a property on an\nobject or an element in an array. The second argument to `{{get}}` can be a\nstring or a number, depending on the object being accessed.\n\nTo access a property on an object with a string key:\n\n```js\nimport { get } from '@ember/helper';\n\n<template>\n {{get @someObject \"objectKey\"}}\n</template>\n```\n\nTo access the first element in an array:\n\n```js\nimport { get } from '@ember/helper';\n\n<template>\n {{get @someArray 0}}\n</template>\n```\n\nTo access a property on an object with a dynamic key:\n\n```js\nimport { get } from '@ember/helper';\n\n<template>\n {{get @address @field}}\n</template>\n```\n\nThis will display the result of `@foo.item1` when `index` is `1`, and\n`this.foo.item2` when `index` is `2`, etc.",
|
|
14070
14070
|
"class": "@ember/helper",
|
|
14071
14071
|
"module": "@ember/helper"
|
|
14072
14072
|
},
|
|
14073
14073
|
{
|
|
14074
14074
|
"file": "packages/@ember/helper/index.ts",
|
|
14075
|
-
"line":
|
|
14075
|
+
"line": 441,
|
|
14076
14076
|
"description": "`{{fn}}` is a helper that receives a function and some arguments, and returns\na new function that combines. This allows you to pass parameters along to\nfunctions in your templates:\n\n```js\nimport { fn } from '@ember/helper';\n\nfunction showAlert(message) {\n alert(`The message is: '${message}'`);\n}\n\n<template>\n <button type=\"button\" {{on \"click\" (fn showAlert \"Hello!\")}}>\n Click me!\n </button>\n</template>\n```",
|
|
14077
14077
|
"class": "@ember/helper",
|
|
14078
14078
|
"module": "@ember/helper"
|
|
14079
14079
|
},
|
|
14080
14080
|
{
|
|
14081
14081
|
"file": "packages/@ember/helper/index.ts",
|
|
14082
|
-
"line":
|
|
14082
|
+
"line": 463,
|
|
14083
14083
|
"description": "The `{{gt}}` helper returns `true` if the first argument is greater than\nthe second argument.\n\n```js\nimport { gt } from '@ember/helper';\n\n<template>\n {{if (gt @score 100) \"High score!\" \"Keep trying\"}}\n</template>\n```\n\nIn strict-mode (gjs/gts) templates, `gt` is available as a keyword and\ndoes not need to be imported.",
|
|
14084
14084
|
"itemtype": "method",
|
|
14085
14085
|
"name": "gt",
|
|
@@ -14104,7 +14104,7 @@
|
|
|
14104
14104
|
},
|
|
14105
14105
|
{
|
|
14106
14106
|
"file": "packages/@ember/helper/index.ts",
|
|
14107
|
-
"line":
|
|
14107
|
+
"line": 486,
|
|
14108
14108
|
"description": "The `{{gte}}` helper returns `true` if the first argument is greater than\nor equal to the second argument.\n\n```js\nimport { gte } from '@ember/helper';\n\n<template>\n {{if (gte @age 18) \"Adult\" \"Minor\"}}\n</template>\n```\n\nIn strict-mode (gjs/gts) templates, `gte` is available as a keyword and\ndoes not need to be imported.",
|
|
14109
14109
|
"itemtype": "method",
|
|
14110
14110
|
"name": "gte",
|
|
@@ -14129,7 +14129,7 @@
|
|
|
14129
14129
|
},
|
|
14130
14130
|
{
|
|
14131
14131
|
"file": "packages/@ember/helper/index.ts",
|
|
14132
|
-
"line":
|
|
14132
|
+
"line": 509,
|
|
14133
14133
|
"description": "The `{{lt}}` helper returns `true` if the first argument is less than\nthe second argument.\n\n```js\nimport { lt } from '@ember/helper';\n\n<template>\n {{if (lt @temperature 0) \"Freezing\" \"Above zero\"}}\n</template>\n```\n\nIn strict-mode (gjs/gts) templates, `lt` is available as a keyword and\ndoes not need to be imported.",
|
|
14134
14134
|
"itemtype": "method",
|
|
14135
14135
|
"name": "lt",
|
|
@@ -14154,7 +14154,7 @@
|
|
|
14154
14154
|
},
|
|
14155
14155
|
{
|
|
14156
14156
|
"file": "packages/@ember/helper/index.ts",
|
|
14157
|
-
"line":
|
|
14157
|
+
"line": 532,
|
|
14158
14158
|
"description": "The `{{lte}}` helper returns `true` if the first argument is less than\nor equal to the second argument.\n\n```js\nimport { lte } from '@ember/helper';\n\n<template>\n {{if (lte @count 0) \"Empty\" \"Has items\"}}\n</template>\n```\n\nIn strict-mode (gjs/gts) templates, `lte` is available as a keyword and\ndoes not need to be imported.",
|
|
14159
14159
|
"itemtype": "method",
|
|
14160
14160
|
"name": "lte",
|
|
@@ -14179,7 +14179,7 @@
|
|
|
14179
14179
|
},
|
|
14180
14180
|
{
|
|
14181
14181
|
"file": "packages/@ember/helper/index.ts",
|
|
14182
|
-
"line":
|
|
14182
|
+
"line": 555,
|
|
14183
14183
|
"description": "The `element` helper lets you dynamically set the tag name of an element.\n\n```js\nimport { element } from '@ember/helper';\n\n<template>\n {{#let (element @tagName) as |Tag|}}\n <Tag class=\"my-element\">Hello</Tag>\n {{/let}}\n</template>\n```\n\nWhen `@tagName` is `\"h1\"`, this renders `<h1 class=\"my-element\">Hello</h1>`.\nWhen `@tagName` is an empty string, the block content is rendered without a\nwrapping element. When `@tagName` is `null` or `undefined`, nothing is rendered.",
|
|
14184
14184
|
"itemtype": "method",
|
|
14185
14185
|
"name": "element",
|
|
@@ -14195,14 +14195,14 @@
|
|
|
14195
14195
|
},
|
|
14196
14196
|
{
|
|
14197
14197
|
"file": "packages/@ember/helper/index.ts",
|
|
14198
|
-
"line":
|
|
14198
|
+
"line": 578,
|
|
14199
14199
|
"description": "Use the {{uniqueId}} helper to generate a unique ID string suitable for use as\nan ID attribute in the DOM.\n\nEach invocation of {{uniqueId}} will return a new, unique ID string.\nYou can use the `let` helper to create an ID that can be reused within a template.\n\n```js\nimport { uniqueId } from '@ember/helper';\n\n<template>\n {{#let (uniqueId) as |emailId|}}\n <label for={{emailId}}>Email address</label>\n <input id={{emailId}} type=\"email\" />\n {{/let}}\n</template>\n```",
|
|
14200
14200
|
"class": "@ember/helper",
|
|
14201
14201
|
"module": "@ember/helper"
|
|
14202
14202
|
},
|
|
14203
14203
|
{
|
|
14204
14204
|
"file": "packages/@ember/helper/index.ts",
|
|
14205
|
-
"line":
|
|
14205
|
+
"line": 599,
|
|
14206
14206
|
"description": "The `{{eq}}` helper returns `true` if its two arguments are strictly equal\n(`===`). Takes exactly two arguments.\n\n```js\nimport { eq } from '@ember/helper';\n\n<template>\n {{if (eq @status \"active\") \"Active\" \"Inactive\"}}\n</template>\n```\n\nIn strict-mode (gjs/gts) templates, `eq` is available as a keyword and\ndoes not need to be imported.",
|
|
14207
14207
|
"itemtype": "method",
|
|
14208
14208
|
"name": "eq",
|
|
@@ -14227,7 +14227,7 @@
|
|
|
14227
14227
|
},
|
|
14228
14228
|
{
|
|
14229
14229
|
"file": "packages/@ember/helper/index.ts",
|
|
14230
|
-
"line":
|
|
14230
|
+
"line": 622,
|
|
14231
14231
|
"description": "The `{{neq}}` helper returns `true` if its two arguments are strictly\nnot equal (`!==`). Takes exactly two arguments.\n\n```js\nimport { neq } from '@ember/helper';\n\n<template>\n {{if (neq @status \"active\") \"Not active\" \"Active\"}}\n</template>\n```\n\nIn strict-mode (gjs/gts) templates, `neq` is available as a keyword and\ndoes not need to be imported.",
|
|
14232
14232
|
"itemtype": "method",
|
|
14233
14233
|
"name": "neq",
|
|
@@ -14252,7 +14252,7 @@
|
|
|
14252
14252
|
},
|
|
14253
14253
|
{
|
|
14254
14254
|
"file": "packages/@ember/helper/index.ts",
|
|
14255
|
-
"line":
|
|
14255
|
+
"line": 645,
|
|
14256
14256
|
"description": "The `{{and}}` helper evaluates arguments left to right, returning the first\nfalsy value (using Handlebars truthiness) or the right-most value if all\nare truthy. Requires at least two arguments.\n\n```js\nimport { and } from '@ember/helper';\n\n<template>\n {{if (and @isAdmin @isLoggedIn) \"Welcome, admin!\" \"Access denied\"}}\n</template>\n```\n\nIn strict-mode (gjs/gts) templates, `and` is available as a keyword and\ndoes not need to be imported.",
|
|
14257
14257
|
"itemtype": "method",
|
|
14258
14258
|
"name": "and",
|
|
@@ -14272,7 +14272,7 @@
|
|
|
14272
14272
|
},
|
|
14273
14273
|
{
|
|
14274
14274
|
"file": "packages/@ember/helper/index.ts",
|
|
14275
|
-
"line":
|
|
14275
|
+
"line": 668,
|
|
14276
14276
|
"description": "The `{{or}}` helper evaluates arguments left to right, returning the first\ntruthy value (using Handlebars truthiness) or the right-most value if all\nare falsy. Requires at least two arguments.\n\n```js\nimport { or } from '@ember/helper';\n\n<template>\n {{if (or @hasAccess @isAdmin) \"Welcome!\" \"No access\"}}\n</template>\n```\n\nIn strict-mode (gjs/gts) templates, `or` is available as a keyword and\ndoes not need to be imported.",
|
|
14277
14277
|
"itemtype": "method",
|
|
14278
14278
|
"name": "or",
|
|
@@ -14292,7 +14292,7 @@
|
|
|
14292
14292
|
},
|
|
14293
14293
|
{
|
|
14294
14294
|
"file": "packages/@ember/helper/index.ts",
|
|
14295
|
-
"line":
|
|
14295
|
+
"line": 691,
|
|
14296
14296
|
"description": "The `{{not}}` helper returns the logical negation of its argument using\nHandlebars truthiness. Takes exactly one argument.\n\n```js\nimport { not } from '@ember/helper';\n\n<template>\n {{if (not @isDisabled) \"Enabled\" \"Disabled\"}}\n</template>\n```\n\nIn strict-mode (gjs/gts) templates, `not` is available as a keyword and\ndoes not need to be imported.",
|
|
14297
14297
|
"itemtype": "method",
|
|
14298
14298
|
"name": "not",
|
|
@@ -15698,7 +15698,7 @@
|
|
|
15698
15698
|
{
|
|
15699
15699
|
"file": "packages/@ember/object/index.ts",
|
|
15700
15700
|
"line": 48,
|
|
15701
|
-
"description": "Decorator that turns the target function into an Action which can be accessed\ndirectly by reference.\n\n```
|
|
15701
|
+
"description": "Decorator that turns the target function into an Action which can be accessed\ndirectly by reference.\n\n```gjs\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\n\nexport default class Tooltip extends Component {\n @tracked isShowing = false;\n\n @action\n toggleShowing() {\n this.isShowing = !this.isShowing;\n }\n \n <template>\n <button {{on \"click\" this.toggleShowing}}>Show tooltip</button>\n \n {{#if isShowing}}\n <div class=\"tooltip\">\n I'm a tooltip!\n </div>\n {{/if}}\n </template>\n}\n```\n\nIt also binds the function directly to the instance, so it can be used in any\ncontext and will correctly refer to the class it came from:\n\n```gjs\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\n\nexport default class Tooltip extends Component {\n constructor() {\n super(...arguments);\n\n // this.toggleShowing is still bound correctly when added to\n // the event listener\n document.addEventListener('click', this.toggleShowing);\n }\n\n @tracked isShowing = false;\n\n @action\n toggleShowing() {\n this.isShowing = !this.isShowing;\n }\n \n <template>\n {{!-- ...--}}\n </template>\n}\n```",
|
|
15702
15702
|
"access": "public",
|
|
15703
15703
|
"tagname": "",
|
|
15704
15704
|
"itemtype": "method",
|
|
@@ -15720,8 +15720,8 @@
|
|
|
15720
15720
|
},
|
|
15721
15721
|
{
|
|
15722
15722
|
"file": "packages/@ember/object/index.ts",
|
|
15723
|
-
"line":
|
|
15724
|
-
"description": "Specify a method that observes property changes.\n\n```javascript\nimport EmberObject from '@ember/object';\nimport { observer } from '@ember/object';\n\nexport default EmberObject.extend({\n valueObserver: observer('value', function() {\n // Executes whenever the \"value\" property changes\n })\n});\n```\n\
|
|
15723
|
+
"line": 241,
|
|
15724
|
+
"description": "Specify a method that observes property changes.\n\n```javascript\nimport EmberObject from '@ember/object';\nimport { observer } from '@ember/object';\n\nexport default EmberObject.extend({\n valueObserver: observer('value', function() {\n // Executes whenever the \"value\" property changes\n })\n});\n```\n\nWhile observers are still supported, there are [plans to deprecate them](https://github.com/emberjs/rfcs/pull/1115)\nSee the [in-progress deprecation guide](https://github.com/ember-learn/deprecation-app/pull/1407) \nfor guidance on how to avoid using observers.",
|
|
15725
15725
|
"itemtype": "method",
|
|
15726
15726
|
"name": "observer",
|
|
15727
15727
|
"params": [
|
|
@@ -16031,7 +16031,7 @@
|
|
|
16031
16031
|
{
|
|
16032
16032
|
"file": "packages/@ember/object/observable.ts",
|
|
16033
16033
|
"line": 250,
|
|
16034
|
-
"description": "Adds an observer on a property.\n\nThis is the core method used to register an observer for a property.\n\nOnce you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.\n\nThere are two common invocation patterns for `.addObserver()`:\n\n- Passing two arguments:\n - the name of the property to observe (as a string)\n - the function to invoke (an actual function)\n- Passing three arguments:\n - the name of the property to observe (as a string)\n - the target object (will be used to look up and invoke a\n function on)\n - the name of the function to invoke on the target object\n (as a string).\n\n```app/components/my-component.js\nimport Component from '@ember/component';\n\nexport default Component.extend({\n init() {\n this._super(...arguments);\n\n // the following are equivalent:\n\n // using three arguments\n this.addObserver('foo', this, 'fooDidChange');\n\n // using two arguments\n this.addObserver('foo', (...args) => {\n this.fooDidChange(...args);\n });\n },\n\n fooDidChange() {\n // your custom logic code\n }\n});\n```\n\n### Observer Methods\n\nObserver methods have the following signature:\n\n```app/components/my-component.js\nimport Component from '@ember/component';\n\nexport default Component.extend({\n init() {\n this._super(...arguments);\n this.addObserver('foo', this, 'fooDidChange');\n },\n\n fooDidChange(sender, key, value, rev) {\n // your code\n }\n});\n```\n\nThe `sender` is the object that changed. The `key` is the property that\nchanges. The `value` property is currently reserved and unused. The `rev`\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.\n\nUsually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.",
|
|
16034
|
+
"description": "Adds an observer on a property.\n\nThis is the core method used to register an observer for a property.\n\nOnce you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.\n\nThere are two common invocation patterns for `.addObserver()`:\n\n- Passing two arguments:\n - the name of the property to observe (as a string)\n - the function to invoke (an actual function)\n- Passing three arguments:\n - the name of the property to observe (as a string)\n - the target object (will be used to look up and invoke a\n function on)\n - the name of the function to invoke on the target object\n (as a string).\n\n```app/components/my-component.js\nimport Component from '@ember/component';\n\nexport default Component.extend({\n init() {\n this._super(...arguments);\n\n // the following are equivalent:\n\n // using three arguments\n this.addObserver('foo', this, 'fooDidChange');\n\n // using two arguments\n this.addObserver('foo', (...args) => {\n this.fooDidChange(...args);\n });\n },\n\n fooDidChange() {\n // your custom logic code\n }\n});\n```\n\n### Observer Methods\n\nObserver methods have the following signature:\n\n```app/components/my-component.js\nimport Component from '@ember/component';\n\nexport default Component.extend({\n init() {\n this._super(...arguments);\n this.addObserver('foo', this, 'fooDidChange');\n },\n\n fooDidChange(sender, key, value, rev) {\n // your code\n }\n});\n```\n\nThe `sender` is the object that changed. The `key` is the property that\nchanges. The `value` property is currently reserved and unused. The `rev`\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.\n\nUsually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.\n\nWhile observers are still supported, there are [plans to deprecate them](https://github.com/emberjs/rfcs/pull/1115)\nSee the [in-progress deprecation guide](https://github.com/ember-learn/deprecation-app/pull/1407)\nfor guidance on how to avoid using observers.",
|
|
16035
16035
|
"itemtype": "method",
|
|
16036
16036
|
"name": "addObserver",
|
|
16037
16037
|
"params": [
|
|
@@ -16067,7 +16067,7 @@
|
|
|
16067
16067
|
},
|
|
16068
16068
|
{
|
|
16069
16069
|
"file": "packages/@ember/object/observable.ts",
|
|
16070
|
-
"line":
|
|
16070
|
+
"line": 340,
|
|
16071
16071
|
"description": "Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to `addObserver()` and your\ntarget will no longer receive notifications.",
|
|
16072
16072
|
"itemtype": "method",
|
|
16073
16073
|
"name": "removeObserver",
|
|
@@ -16104,7 +16104,7 @@
|
|
|
16104
16104
|
},
|
|
16105
16105
|
{
|
|
16106
16106
|
"file": "packages/@ember/object/observable.ts",
|
|
16107
|
-
"line":
|
|
16107
|
+
"line": 361,
|
|
16108
16108
|
"description": "Set the value of a property to the current value plus some amount.\n\n```javascript\nperson.incrementProperty('age');\nteam.incrementProperty('score', 2);\n```",
|
|
16109
16109
|
"itemtype": "method",
|
|
16110
16110
|
"name": "incrementProperty",
|
|
@@ -16131,7 +16131,7 @@
|
|
|
16131
16131
|
},
|
|
16132
16132
|
{
|
|
16133
16133
|
"file": "packages/@ember/object/observable.ts",
|
|
16134
|
-
"line":
|
|
16134
|
+
"line": 378,
|
|
16135
16135
|
"description": "Set the value of a property to the current value minus some amount.\n\n```javascript\nplayer.decrementProperty('lives');\norc.decrementProperty('health', 5);\n```",
|
|
16136
16136
|
"itemtype": "method",
|
|
16137
16137
|
"name": "decrementProperty",
|
|
@@ -16158,7 +16158,7 @@
|
|
|
16158
16158
|
},
|
|
16159
16159
|
{
|
|
16160
16160
|
"file": "packages/@ember/object/observable.ts",
|
|
16161
|
-
"line":
|
|
16161
|
+
"line": 395,
|
|
16162
16162
|
"description": "Set the value of a boolean property to the opposite of its\ncurrent value.\n\n```javascript\nstarship.toggleProperty('warpDriveEngaged');\n```",
|
|
16163
16163
|
"itemtype": "method",
|
|
16164
16164
|
"name": "toggleProperty",
|
|
@@ -16180,7 +16180,7 @@
|
|
|
16180
16180
|
},
|
|
16181
16181
|
{
|
|
16182
16182
|
"file": "packages/@ember/object/observable.ts",
|
|
16183
|
-
"line":
|
|
16183
|
+
"line": 410,
|
|
16184
16184
|
"description": "Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.",
|
|
16185
16185
|
"itemtype": "method",
|
|
16186
16186
|
"name": "cacheFor",
|
|
@@ -16202,7 +16202,7 @@
|
|
|
16202
16202
|
},
|
|
16203
16203
|
{
|
|
16204
16204
|
"file": "packages/@ember/object/observable.ts",
|
|
16205
|
-
"line":
|
|
16205
|
+
"line": 440,
|
|
16206
16206
|
"description": "Begins a grouping of property changes.\n\nYou can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\n`endPropertyChanges()` to deliver the deferred change notifications and end\ndeferring.",
|
|
16207
16207
|
"itemtype": "method",
|
|
16208
16208
|
"name": "beginPropertyChanges",
|
|
@@ -16217,7 +16217,7 @@
|
|
|
16217
16217
|
},
|
|
16218
16218
|
{
|
|
16219
16219
|
"file": "packages/@ember/object/observable.ts",
|
|
16220
|
-
"line":
|
|
16220
|
+
"line": 460,
|
|
16221
16221
|
"description": "Ends a grouping of property changes.\n\nYou can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\n`beginPropertyChanges()` at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.",
|
|
16222
16222
|
"itemtype": "method",
|
|
16223
16223
|
"name": "endPropertyChanges",
|
|
@@ -16232,7 +16232,7 @@
|
|
|
16232
16232
|
},
|
|
16233
16233
|
{
|
|
16234
16234
|
"file": "packages/@ember/object/observable.ts",
|
|
16235
|
-
"line":
|
|
16235
|
+
"line": 504,
|
|
16236
16236
|
"description": "Returns `true` if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.",
|
|
16237
16237
|
"itemtype": "method",
|
|
16238
16238
|
"name": "hasObserverFor",
|
|
@@ -18065,7 +18065,7 @@
|
|
|
18065
18065
|
{
|
|
18066
18066
|
"file": "packages/@ember/routing/route.ts",
|
|
18067
18067
|
"line": 1104,
|
|
18068
|
-
"description": "A hook you can implement to convert the URL into the model for\nthis route.\n\n```app/router.js\n// ...\n\nRouter.map(function() {\n this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;\n```\n\nNote that for routes with dynamic segments, this hook is not always\nexecuted. If the route is entered through a transition (e.g. when\nusing the `link-to`
|
|
18068
|
+
"description": "A hook you can implement to convert the URL into the model for\nthis route.\n\n```app/router.js\n// ...\n\nRouter.map(function() {\n this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;\n```\n\nNote that for routes with dynamic segments, this hook is not always\nexecuted. If the route is entered through a transition (e.g. when\nusing the `link-to` helper or the `transitionTo` method\nof routes), and a model context is already provided this hook\nis not called.\n\nA model context does not include a primitive string or number,\nwhich does cause the model hook to be called.\n\nRoutes without dynamic segments will always execute the model hook.\n\n```javascript\n// no dynamic segment, model hook always called\nthis.router.transitionTo('posts');\n\n// model passed in, so model hook not called\nthePost = store.findRecord('post', 1);\nthis.router.transitionTo('post', thePost);\n\n// integer passed in, model hook is called\nthis.router.transitionTo('post', 1);\n\n// model id passed in, model hook is called\n// useful for forcing the hook to execute\nthePost = store.findRecord('post', 1);\nthis.router.transitionTo('post', thePost.id);\n```\n\nThis hook follows the asynchronous/promise semantics\ndescribed in the documentation for `beforeModel`. In particular,\nif a promise returned from `model` fails, the error will be\nhandled by the `error` hook on `Route`.\n\nNote that the legacy behavior of automatically defining a model\nhook when a dynamic segment ending in `_id` is present is\n[deprecated](https://deprecations.emberjs.com/v5.x#toc_deprecate-implicit-route-model).\nYou should explicitly define a model hook whenever any segments are\npresent.\n\nExample\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class PostRoute extends Route {\n @service store;\n\n model(params) {\n return this.store.findRecord('post', params.post_id);\n }\n}\n```",
|
|
18069
18069
|
"itemtype": "method",
|
|
18070
18070
|
"name": "model",
|
|
18071
18071
|
"params": [
|
|
@@ -18337,7 +18337,7 @@
|
|
|
18337
18337
|
{
|
|
18338
18338
|
"file": "packages/@ember/routing/router-service.ts",
|
|
18339
18339
|
"line": 90,
|
|
18340
|
-
"description": "Transition the application into another route. The route may\nbe either a single route or route path:\n\nCalling `transitionTo` from the Router service will cause default query parameter values to be included in the URL.\nThis behavior is different from calling `transitionTo` on a route or `transitionToRoute` on a controller.\nSee the [Router Service RFC](https://github.com/emberjs/rfcs/blob/master/text/0095-router-service.md#query-parameter-semantics) for more info.\n\nIn the following example we use the Router service to navigate to a route with a\nspecific model from a Component in the first action, and in the second we trigger\na query-params only transition.\n\n```app/components/example.
|
|
18340
|
+
"description": "Transition the application into another route. The route may\nbe either a single route or route path:\n\nCalling `transitionTo` from the Router service will cause default query parameter values to be included in the URL.\nThis behavior is different from calling `transitionTo` on a route or `transitionToRoute` on a controller.\nSee the [Router Service RFC](https://github.com/emberjs/rfcs/blob/master/text/0095-router-service.md#query-parameter-semantics) for more info.\n\nIn the following example we use the Router service to navigate to a route with a\nspecific model from a Component in the first action, and in the second we trigger\na query-params only transition.\n\n```app/components/example.gjs\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { service } from '@ember/service';\n\nexport default class extends Component {\n @service router;\n\n @action\n goToComments(post) {\n this.router.transitionTo('comments', post);\n }\n\n @action\n fetchMoreComments(latestComment) {\n this.router.transitionTo({\n queryParams: { commentsAfter: latestComment }\n });\n }\n}\n```",
|
|
18341
18341
|
"itemtype": "method",
|
|
18342
18342
|
"name": "transitionTo",
|
|
18343
18343
|
"params": [
|
|
@@ -18405,7 +18405,7 @@
|
|
|
18405
18405
|
{
|
|
18406
18406
|
"file": "packages/@ember/routing/router-service.ts",
|
|
18407
18407
|
"line": 190,
|
|
18408
|
-
"description": "Generate a URL based on the supplied route name and optionally a model. The\nURL is returned as a string that can be used for any purpose.\n\nIn this example, the URL for the `author.books` route for a given author\nis copied to the clipboard.\n\n```app/templates/application.
|
|
18408
|
+
"description": "Generate a URL based on the supplied route name and optionally a model. The\nURL is returned as a string that can be used for any purpose.\n\nIn this example, the URL for the `author.books` route for a given author\nis copied to the clipboard.\n\n```app/templates/application.gjs\nimport CopyLink from '../components/copy-link';\n \n<template>\n <CopyLink @author={{hash id=\"tomster\" name=\"Tomster\"}} />\n</template>\n```\n\n```app/components/copy-link.gjs\nimport Component from '@glimmer/component';\nimport { service } from '@ember/service';\nimport { action } from '@ember/object';\n\nexport default class CopyLinkComponent extends Component {\n @service router;\n @service clipboard;\n\n @action\n copyBooksURL() {\n if (this.author) {\n const url = this.router.urlFor('author.books', this.args.author);\n this.clipboard.set(url);\n // Clipboard now has /author/tomster/books\n }\n }\n}\n```\n\nJust like with `transitionTo` and `replaceWith`, `urlFor` can also handle\nquery parameters.\n\n```app/templates/application.gjs\nimport CopyLink from '../components/copy-link';\n\n<template>\n <CopyLink @author={{hash id=\"tomster\" name=\"Tomster\"}} />\n</template>\n```\n\n```app/components/copy-link.gjs\nimport Component from '@glimmer/component';\nimport { service } from '@ember/service';\nimport { action } from '@ember/object';\n\nexport default class CopyLinkComponent extends Component {\n @service router;\n @service clipboard;\n\n @action\n copyOnlyEmberBooksURL() {\n if (this.author) {\n const url = this.router.urlFor('author.books', this.author, {\n queryParams: { filter: 'emberjs' }\n });\n this.clipboard.set(url);\n // Clipboard now has /author/tomster/books?filter=emberjs\n }\n }\n}\n```",
|
|
18409
18409
|
"itemtype": "method",
|
|
18410
18410
|
"name": "urlFor",
|
|
18411
18411
|
"params": [
|
|
@@ -18437,8 +18437,8 @@
|
|
|
18437
18437
|
},
|
|
18438
18438
|
{
|
|
18439
18439
|
"file": "packages/@ember/routing/router-service.ts",
|
|
18440
|
-
"line":
|
|
18441
|
-
"description": "Returns `true` if `routeName/models/queryParams` is the active route, where `models` and `queryParams` are optional.\nSee [model](api/ember/release/classes/Route/methods/model?anchor=model) and\n[queryParams](/api/ember/3.7/classes/Route/properties/queryParams?anchor=queryParams) for more information about these arguments.\n\nIn the following example, `isActive` will return `true` if the current route is `/posts`.\n\n```app/components/posts.
|
|
18440
|
+
"line": 274,
|
|
18441
|
+
"description": "Returns `true` if `routeName/models/queryParams` is the active route, where `models` and `queryParams` are optional.\nSee [model](api/ember/release/classes/Route/methods/model?anchor=model) and\n[queryParams](/api/ember/3.7/classes/Route/properties/queryParams?anchor=queryParams) for more information about these arguments.\n\nIn the following example, `isActive` will return `true` if the current route is `/posts`.\n\n```app/components/posts.gjs\nimport Component from '@glimmer/component';\nimport { service } from '@ember/service';\n\nexport default class extends Component {\n @service router;\n\n displayComments() {\n return this.router.isActive('posts');\n }\n});\n```\n\nThe next example includes a dynamic segment, and will return `true` if the current route is `/posts/1`,\nassuming the post has an id of 1:\n\n```app/components/posts.gjs\nimport Component from '@glimmer/component';\nimport { service } from '@ember/service';\n\nexport default class extends Component {\n @service router;\n\n displayComments(post) {\n return this.router.isActive('posts', post.id);\n }\n});\n```\n\nWhere `post.id` is the id of a specific post, which is represented in the route as /posts/[post.id].\nIf `post.id` is equal to 1, then isActive will return true if the current route is /posts/1, and false if the route is anything else.",
|
|
18442
18442
|
"itemtype": "method",
|
|
18443
18443
|
"name": "isActive",
|
|
18444
18444
|
"params": [
|
|
@@ -18470,8 +18470,8 @@
|
|
|
18470
18470
|
},
|
|
18471
18471
|
{
|
|
18472
18472
|
"file": "packages/@ember/routing/router-service.ts",
|
|
18473
|
-
"line":
|
|
18474
|
-
"description": "Takes a string URL and returns a `RouteInfo` for the leafmost route represented\nby the URL. Returns `null` if the URL is not recognized. This method expects to\nreceive the actual URL as seen by the browser including the app's `rootURL`.\n\nSee [RouteInfo](/ember/release/classes/RouteInfo) for more info.\n\nIn the following example `recognize` is used to verify if a path belongs to our\napplication before transitioning to it.\n\n
|
|
18473
|
+
"line": 379,
|
|
18474
|
+
"description": "Takes a string URL and returns a `RouteInfo` for the leafmost route represented\nby the URL. Returns `null` if the URL is not recognized. This method expects to\nreceive the actual URL as seen by the browser including the app's `rootURL`.\n\nSee [RouteInfo](/ember/release/classes/RouteInfo) for more info.\n\nIn the following example `recognize` is used to verify if a path belongs to our\napplication before transitioning to it.\n\n```js\nimport Component from '@ember/component';\nimport { service } from '@ember/service';\n\nexport default class extends Component {\n @service router;\n path = '/';\n\n click() {\n if (this.router.recognize(this.path)) {\n this.router.transitionTo(this.path);\n }\n }\n}\n```",
|
|
18475
18475
|
"itemtype": "method",
|
|
18476
18476
|
"name": "recognize",
|
|
18477
18477
|
"params": [
|
|
@@ -18492,7 +18492,7 @@
|
|
|
18492
18492
|
},
|
|
18493
18493
|
{
|
|
18494
18494
|
"file": "packages/@ember/routing/router-service.ts",
|
|
18495
|
-
"line":
|
|
18495
|
+
"line": 420,
|
|
18496
18496
|
"description": "Takes a string URL and returns a promise that resolves to a\n`RouteInfoWithAttributes` for the leafmost route represented by the URL.\nThe promise rejects if the URL is not recognized or an unhandled exception\nis encountered. This method expects to receive the actual URL as seen by\nthe browser including the app's `rootURL`.",
|
|
18497
18497
|
"itemtype": "method",
|
|
18498
18498
|
"name": "recognizeAndLoad",
|
|
@@ -18514,7 +18514,7 @@
|
|
|
18514
18514
|
},
|
|
18515
18515
|
{
|
|
18516
18516
|
"file": "packages/@ember/routing/router-service.ts",
|
|
18517
|
-
"line":
|
|
18517
|
+
"line": 442,
|
|
18518
18518
|
"description": "You can register a listener for events emitted by this service with `.on()`:\n\n```app/routes/contact-form.js\nimport Route from '@ember/routing';\nimport { service } from '@ember/service';\n\nexport default class extends Route {\n @service router;\n\n activate() {\n this.router.on('routeWillChange', (transition) => {\n if (!transition.to.find(route => route.name === this.routeName)) {\n alert(\"Please save or cancel your changes.\");\n transition.abort();\n }\n })\n }\n}\n```",
|
|
18519
18519
|
"itemtype": "method",
|
|
18520
18520
|
"name": "on",
|
|
@@ -18537,7 +18537,7 @@
|
|
|
18537
18537
|
},
|
|
18538
18538
|
{
|
|
18539
18539
|
"file": "packages/@ember/routing/router-service.ts",
|
|
18540
|
-
"line":
|
|
18540
|
+
"line": 469,
|
|
18541
18541
|
"description": "You can unregister a listener for events emitted by this service with `.off()`:\n\n```app/routes/contact-form.js\nimport Route from '@ember/routing';\nimport { service } from '@ember/service';\n\nexport default class ContactFormRoute extends Route {\n @service router;\n\n callback = (transition) => {\n if (!transition.to.find(route => route.name === this.routeName)) {\n alert('Please save or cancel your changes.');\n transition.abort();\n }\n };\n\n activate() {\n this.router.on('routeWillChange', this.callback);\n }\n\n deactivate() {\n this.router.off('routeWillChange', this.callback);\n }\n}\n```",
|
|
18542
18542
|
"itemtype": "method",
|
|
18543
18543
|
"name": "off",
|
|
@@ -18560,7 +18560,7 @@
|
|
|
18560
18560
|
},
|
|
18561
18561
|
{
|
|
18562
18562
|
"file": "packages/@ember/routing/router-service.ts",
|
|
18563
|
-
"line":
|
|
18563
|
+
"line": 502,
|
|
18564
18564
|
"description": "The `routeWillChange` event is fired at the beginning of any\nattempted transition with a `Transition` object as the sole\nargument. This action can be used for aborting, redirecting,\nor decorating the transition from the currently active routes.\n\nA good example is preventing navigation when a form is\nhalf-filled out:\n\n```app/routes/contact-form.js\nimport Route from '@ember/routing';\nimport { service } from '@ember/service';\n\nexport default class extends Route {\n @service router;\n\n activate() {\n this.router.on('routeWillChange', (transition) => {\n if (!transition.to.find(route => route.name === this.routeName)) {\n alert(\"Please save or cancel your changes.\");\n transition.abort();\n }\n })\n }\n}\n```\n\nThe `routeWillChange` event fires whenever a new route is chosen as the desired target of a transition. This includes `transitionTo`, `replaceWith`, all redirection for any reason including error handling, and abort. Aborting implies changing the desired target back to where you already were. Once a transition has completed, `routeDidChange` fires.",
|
|
18565
18565
|
"itemtype": "event",
|
|
18566
18566
|
"name": "routeWillChange",
|
|
@@ -18578,7 +18578,7 @@
|
|
|
18578
18578
|
},
|
|
18579
18579
|
{
|
|
18580
18580
|
"file": "packages/@ember/routing/router-service.ts",
|
|
18581
|
-
"line":
|
|
18581
|
+
"line": 536,
|
|
18582
18582
|
"description": "The `routeDidChange` event only fires once a transition has settled.\nThis includes aborts and error substates. Like the `routeWillChange` event\nit receives a Transition as the sole argument.\n\nA good example is sending some analytics when the route has transitioned:\n\n```app/routes/contact-form.js\nimport Route from '@ember/routing';\nimport { service } from '@ember/service';\n\nexport default class extends Route {\n @service router;\n\n activate() {\n this.router.on('routeDidChange', (transition) => {\n ga.send('pageView', {\n current: transition.to.name,\n from: transition.from.name\n });\n })\n }\n}\n```\n\n`routeDidChange` will be called after any `Route`'s\n[didTransition](/ember/release/classes/Route/events/didTransition?anchor=didTransition)\naction has been fired.\nThe updates of properties\n[currentURL](/ember/release/classes/RouterService/properties/currentURL?anchor=currentURL),\n[currentRouteName](/ember/release/classes/RouterService/properties/currentURL?anchor=currentRouteName)\nand\n[currentRoute](/ember/release/classes/RouterService/properties/currentURL?anchor=currentRoute)\nare completed at the time `routeDidChange` is called.",
|
|
18583
18583
|
"itemtype": "event",
|
|
18584
18584
|
"name": "routeDidChange",
|
|
@@ -18596,7 +18596,7 @@
|
|
|
18596
18596
|
},
|
|
18597
18597
|
{
|
|
18598
18598
|
"file": "packages/@ember/routing/router-service.ts",
|
|
18599
|
-
"line":
|
|
18599
|
+
"line": 576,
|
|
18600
18600
|
"description": "Refreshes all currently active routes, doing a full transition.\nIf a route name is provided and refers to a currently active route,\nit will refresh only that route and its descendents.\nReturns a promise that will be resolved once the refresh is complete.\nAll resetController, beforeModel, model, afterModel, redirect, and setupController\nhooks will be called again. You will get new data from the model hook.",
|
|
18601
18601
|
"itemtype": "method",
|
|
18602
18602
|
"name": "refresh",
|
|
@@ -18618,7 +18618,7 @@
|
|
|
18618
18618
|
},
|
|
18619
18619
|
{
|
|
18620
18620
|
"file": "packages/@ember/routing/router-service.ts",
|
|
18621
|
-
"line":
|
|
18621
|
+
"line": 604,
|
|
18622
18622
|
"description": "Name of the current route.\n\n This property represents the logical name of the route,\n which is dot separated.\n For the following router:\n\n ```app/router.js\n Router.map(function() {\n this.route('about');\n this.route('blog', function () {\n this.route('post', { path: ':post_id' });\n });\n });\n ```\n\n It will return:\n\n * `index` when you visit `/`\n * `about` when you visit `/about`\n * `blog.index` when you visit `/blog`\n * `blog.post` when you visit `/blog/some-post-id`",
|
|
18623
18623
|
"itemtype": "property",
|
|
18624
18624
|
"name": "currentRouteName",
|
|
@@ -18630,7 +18630,7 @@
|
|
|
18630
18630
|
},
|
|
18631
18631
|
{
|
|
18632
18632
|
"file": "packages/@ember/routing/router-service.ts",
|
|
18633
|
-
"line":
|
|
18633
|
+
"line": 634,
|
|
18634
18634
|
"description": "Current URL for the application.\n\n This property represents the URL path for this route.\n For the following router:\n\n ```app/router.js\n Router.map(function() {\n this.route('about');\n this.route('blog', function () {\n this.route('post', { path: ':post_id' });\n });\n });\n ```\n\n It will return:\n\n * `/` when you visit `/`\n * `/about` when you visit `/about`\n * `/blog` when you visit `/blog`\n * `/blog/some-post-id` when you visit `/blog/some-post-id`",
|
|
18635
18635
|
"itemtype": "property",
|
|
18636
18636
|
"name": "currentURL",
|
|
@@ -18642,7 +18642,7 @@
|
|
|
18642
18642
|
},
|
|
18643
18643
|
{
|
|
18644
18644
|
"file": "packages/@ember/routing/router-service.ts",
|
|
18645
|
-
"line":
|
|
18645
|
+
"line": 663,
|
|
18646
18646
|
"description": "The `location` property returns what implementation of the `location` API\nyour application is using, which determines what type of URL is being used.\n\nSee [Location](/ember/release/classes/Location) for more information.\n\nTo force a particular `location` API implementation to be used in your\napplication you can set a location type on your `config/environment`.\nFor example, to set the `history` type:\n\n```config/environment.js\n'use strict';\n\nmodule.exports = function(environment) {\n let ENV = {\n modulePrefix: 'router-service',\n environment,\n rootURL: '/',\n locationType: 'history',\n ...\n }\n}\n```\n\nThe following location types are available by default:\n`hash`, `history`, `none`.\n\nSee [HashLocation](/ember/release/classes/HashLocation).\nSee [HistoryLocation](/ember/release/classes/HistoryLocation).\nSee [NoneLocation](/ember/release/classes/NoneLocation).",
|
|
18647
18647
|
"itemtype": "property",
|
|
18648
18648
|
"name": "location",
|
|
@@ -18657,7 +18657,7 @@
|
|
|
18657
18657
|
},
|
|
18658
18658
|
{
|
|
18659
18659
|
"file": "packages/@ember/routing/router-service.ts",
|
|
18660
|
-
"line":
|
|
18660
|
+
"line": 702,
|
|
18661
18661
|
"description": "The `rootURL` property represents the URL of the root of\nthe application, '/' by default.\nThis prefix is assumed on all routes defined on this app.\n\nIf you change the `rootURL` in your environment configuration\nlike so:\n\n```config/environment.js\n'use strict';\n\nmodule.exports = function(environment) {\n let ENV = {\n modulePrefix: 'router-service',\n environment,\n rootURL: '/my-root',\n …\n }\n]\n```\n\nThis property will return `/my-root`.",
|
|
18662
18662
|
"itemtype": "property",
|
|
18663
18663
|
"name": "rootURL",
|
|
@@ -18669,8 +18669,8 @@
|
|
|
18669
18669
|
},
|
|
18670
18670
|
{
|
|
18671
18671
|
"file": "packages/@ember/routing/router-service.ts",
|
|
18672
|
-
"line":
|
|
18673
|
-
"description": "The `currentRoute` property contains metadata about the current leaf route.\nIt returns a `RouteInfo` object that has information like the route name,\nparams, query params and more.\n\nSee [RouteInfo](/ember/release/classes/RouteInfo) for more info.\n\nThis property is guaranteed to change whenever a route transition\nhappens (even when that transition only changes parameters\nand doesn't change the active route).\n\nUsage example:\n```app/components/header.
|
|
18672
|
+
"line": 732,
|
|
18673
|
+
"description": "The `currentRoute` property contains metadata about the current leaf route.\nIt returns a `RouteInfo` object that has information like the route name,\nparams, query params and more.\n\nSee [RouteInfo](/ember/release/classes/RouteInfo) for more info.\n\nThis property is guaranteed to change whenever a route transition\nhappens (even when that transition only changes parameters\nand doesn't change the active route).\n\nUsage example:\n```app/components/header.gjs\n import Component from '@glimmer/component';\n import { service } from '@ember/service';\n import { notEmpty } from '@ember/object/computed';\n\n export default class extends Component {\n @service router;\n\n @notEmpty('router.currentRoute.child') isChildRoute;\n });\n```",
|
|
18674
18674
|
"itemtype": "property",
|
|
18675
18675
|
"name": "currentRoute",
|
|
18676
18676
|
"type": "RouteInfo",
|
|
@@ -22000,7 +22000,7 @@
|
|
|
22000
22000
|
{
|
|
22001
22001
|
"file": "packages/@glimmer/runtime/lib/helpers/array.ts",
|
|
22002
22002
|
"line": 8,
|
|
22003
|
-
"description": "Use the `{{array}}` helper to create an array to pass as an option to your\ncomponents.\n\n```handlebars\n<MyComponent @people={{array\n 'Tom Dale'\n 'Yehuda Katz'\n this.myOtherPerson}}\n/>\n```\n or\n```handlebars\n{{
|
|
22003
|
+
"description": "Use the `{{array}}` helper to create an array to pass as an option to your\ncomponents.\n\n```handlebars\n<MyComponent @people={{array\n 'Tom Dale'\n 'Yehuda Katz'\n this.myOtherPerson}}\n/>\n```\n or\n```handlebars\n{{yield people=(array\n 'Tom Dale'\n 'Yehuda Katz'\n this.myOtherPerson)\n}}\n```\n\nWould result in an object such as:\n\n```js\n['Tom Dale', 'Yehuda Katz', this.get('myOtherPerson')]\n```\n\nWhere the 3rd item in the array is bound to updates of the `myOtherPerson` property.",
|
|
22004
22004
|
"itemtype": "method",
|
|
22005
22005
|
"name": "array",
|
|
22006
22006
|
"params": [
|
|
@@ -22022,7 +22022,7 @@
|
|
|
22022
22022
|
{
|
|
22023
22023
|
"file": "packages/@glimmer/runtime/lib/helpers/concat.ts",
|
|
22024
22024
|
"line": 18,
|
|
22025
|
-
"description": "Concatenates the given arguments into a string.\n\nExample:\n\n```
|
|
22025
|
+
"description": "Concatenates the given arguments into a string.\n\nExample:\n\n\n```gjs\nimport { concat } from '@ember/helper';\n\n<template>\n{{yield (concat firstName \" \" lastName)}}\n\n{{! would yield name=\"<first name value> <last name value>\" to the component}}\n</template>\n```\n\nor for angle bracket invocation, you actually don't need concat at all.\n\n```handlebars\n<SomeComponent @name=\"{{firstName}} {{lastName}}\" />\n```",
|
|
22026
22026
|
"access": "public",
|
|
22027
22027
|
"tagname": "",
|
|
22028
22028
|
"itemtype": "method",
|
|
@@ -22040,7 +22040,7 @@
|
|
|
22040
22040
|
{
|
|
22041
22041
|
"file": "packages/@glimmer/runtime/lib/helpers/fn.ts",
|
|
22042
22042
|
"line": 18,
|
|
22043
|
-
"description": "The `fn` helper allows you to ensure a function that you are passing off\nto another component, helper, or modifier has access to arguments that are\navailable in the template.\n\nFor example, if you have an `each` helper looping over a number of items, you\nmay need to pass a function that expects to receive the item as an argument\nto a component invoked within the loop. Here's how you could use the `fn`\nhelper to pass both the function and its arguments together:\n\n
|
|
22043
|
+
"description": "The `fn` helper allows you to ensure a function that you are passing off\nto another component, helper, or modifier has access to arguments that are\navailable in the template.\n\nFor example, if you have an `each` helper looping over a number of items, you\nmay need to pass a function that expects to receive the item as an argument\nto a component invoked within the loop. Here's how you could use the `fn`\nhelper to pass both the function and its arguments together:\n\n```app/components/items-listing.gjs\nimport DisplayItem from './display-item';\n \n<template>\n {{#each @items as |item|}}\n <DisplayItem @item=item @select={{fn this.handleSelected item}} />\n {{/each}}\n</template>\n```\n\n```app/components/items-list.gjs\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class ItemsList extends Component {\n handleSelected = (item) => {\n // ...snip...\n }\n}\n```\n\nIn this case the `DisplayItem` component will receive a normal function\nthat it can invoke. When it invokes the function, the `handleSelected`\nfunction will receive the `item` and any arguments passed, thanks to the\n`fn` helper.\n\nLet's take look at what that means in a couple circumstances:\n\n- When invoked as `this.args.select()` the `handleSelected` function will\n receive the `item` from the loop as its first and only argument.\n- When invoked as `this.args.select('foo')` the `handleSelected` function\n will receive the `item` from the loop as its first argument and the\n string `'foo'` as its second argument.\n\nIn the example above, we used an arrow function to ensure that\n`handleSelected` is properly bound to the `items-list`, but let's explore what\nhappens if we left out the arrow function:\n\n```app/components/items-list.gjs\nimport Component from '@glimmer/component';\n\nexport default class ItemsList extends Component {\n handleSelected(item) {\n // ...snip...\n }\n}\n```\n\nIn this example, when `handleSelected` is invoked inside the `display-item`\ncomponent, it will **not** have access to the component instance. In other\nwords, it will have no `this` context, so please make sure your functions\nare bound (via an arrow function or other means) before passing into `fn`!\n\nSee also [partial application](https://en.wikipedia.org/wiki/Partial_application).\n\n`fn` is built-in and does not require any additional imports.",
|
|
22044
22044
|
"itemtype": "method",
|
|
22045
22045
|
"name": "fn",
|
|
22046
22046
|
"access": "public",
|
|
@@ -22051,7 +22051,7 @@
|
|
|
22051
22051
|
{
|
|
22052
22052
|
"file": "packages/@glimmer/runtime/lib/helpers/get.ts",
|
|
22053
22053
|
"line": 12,
|
|
22054
|
-
"description": "Dynamically look up a property on an object. The second argument to `{{get}}`\nshould have a string value, although it can be bound.\n\nFor example, these two usages are equivalent:\n\n```app/components/developer-detail.
|
|
22054
|
+
"description": "Dynamically look up a property on an object. The second argument to `{{get}}`\nshould have a string value, although it can be bound.\n\nFor example, these two usages are equivalent:\n\n```app/components/developer-detail.gjs\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { get } from '@ember/object';\n\nexport default class extends Component {\n @tracked developer = {\n name: \"Sandi Metz\",\n language: \"Ruby\"\n }\n \n <template>\n {{this.developer.name}}\n {{get this.developer \"name\"}}\n </template>\n}\n```\n\nIf there were several facts about a person, the `{{get}}` helper can dynamically\npick one:\n\n```app/templates/application.gjs\n<template>\n <DeveloperDetail @factName=\"language\" />\n</template>\n```\n\n```handlebars\n{{get this.developer @factName}}\n```\n\nFor a more complex example, this template would allow the user to switch\nbetween showing the user's height and weight with a click:\n\n```app/components/developer-detail.gjs\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { get } from '@ember/object';\n \nexport default class extends Component {\n @tracked developer = {\n name: \"Sandi Metz\",\n language: \"Ruby\"\n }\n\n @tracked currentFact = 'name'\n\n showFact = (fact) => {\n this.currentFact = fact;\n }\n \n <template>\n {{get this.developer this.currentFact}}\n\n <button {{on 'click' (fn this.showFact \"name\")}}>Show name</button>\n <button {{on 'click' (fn this.showFact \"language\")}}>Show language</button>\n </template>\n}\n```",
|
|
22055
22055
|
"access": "public",
|
|
22056
22056
|
"tagname": "",
|
|
22057
22057
|
"itemtype": "method",
|
|
@@ -22076,7 +22076,7 @@
|
|
|
22076
22076
|
{
|
|
22077
22077
|
"file": "packages/@glimmer/runtime/lib/helpers/hash.ts",
|
|
22078
22078
|
"line": 8,
|
|
22079
|
-
"description": "Use the `{{hash}}` helper to create a hash to pass as an option to your\ncomponents. This is
|
|
22079
|
+
"description": "Use the `{{hash}}` helper to create a hash to pass as an option to your\ncomponents. This is especially useful for contextual components where you can\njust yield a hash:\n\n```handlebars\n{{yield (hash\n name='Sarah'\n title=office\n)}}\n```\n\nWould result in an object such as:\n\n```js\n{ name: 'Sarah', title: this.get('office') }\n```\n\nWhere the `title` is bound to updates of the `office` property.\n\nNote that the hash is an empty object with no prototype chain, therefore\ncommon methods like `toString` are not available in the resulting hash.\nIf you need to use such a method, you can use the `call` or `apply`\napproach:\n\n```js\nfunction toString(obj) {\n return Object.prototype.toString.apply(obj);\n}\n```",
|
|
22080
22080
|
"itemtype": "method",
|
|
22081
22081
|
"name": "hash",
|
|
22082
22082
|
"params": [
|
|
@@ -22119,7 +22119,7 @@
|
|
|
22119
22119
|
{
|
|
22120
22120
|
"file": "packages/@glimmer/runtime/lib/modifiers/on.ts",
|
|
22121
22121
|
"line": 249,
|
|
22122
|
-
"description": "The `{{on}}` modifier lets you easily add event listeners (it uses\n[EventTarget.addEventListener](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener)\ninternally).\n\nFor example, if you'd like to run a function on your component when a `<button>`\nin the components template is clicked you might do something like:\n\n```app/components/like-post.
|
|
22122
|
+
"description": "The `{{on}}` modifier lets you easily add event listeners (it uses\n[EventTarget.addEventListener](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener)\ninternally).\n\nFor example, if you'd like to run a function on your component when a `<button>`\nin the components template is clicked you might do something like:\n\n```app/components/like-post.gjs\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class LikePostComponent extends Component {\n saveLike = () => {\n // someone likes your post!\n // better send a request off to your server...\n }\n \n <template>\n <button {{on 'click' this.saveLike}}>Like this post!</button>\n </template>\n}\n```\n\n### Arguments\n\n`{{on}}` accepts two positional arguments, and a few named arguments.\n\nThe positional arguments are:\n\n- `event` -- the name to use when calling `addEventListener`\n- `callback` -- the function to be passed to `addEventListener`\n\nThe named arguments are:\n\n- capture -- a `true` value indicates that events of this type will be dispatched\n to the registered listener before being dispatched to any EventTarget beneath it\n in the DOM tree.\n- once -- indicates that the listener should be invoked at most once after being\n added. If true, the listener would be automatically removed when invoked.\n- passive -- if `true`, indicates that the function specified by listener will never\n call preventDefault(). If a passive listener does call preventDefault(), the user\n agent will do nothing other than generate a console warning. See\n [Improving scrolling performance with passive listeners](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Improving_scrolling_performance_with_passive_listeners)\n to learn more.\n\nThe callback function passed to `{{on}}` will receive any arguments that are passed\nto the event handler. Most commonly this would be the `event` itself.\n\nIf you would like to pass additional arguments to the function you should use\nthe `{{fn}}` helper.\n\nFor example, in our example case above if you'd like to pass in the post that\nwas being liked when the button is clicked you could do something like:\n\n```app/components/like-post.hbs\n<button {{on 'click' (fn this.saveLike @post)}}>Like this post!</button>\n```\n\nIn this case, the `saveLike` function will receive two arguments: the click event\nand the value of `@post`.\n\n### Function Context\n\nIn the example above, we used an arrow function to ensure that `likePost` is\nproperly bound to the `items-list`, but let's explore what happens if we\nleft out the arrow function:\n\n```app/components/like-post.gjs\nimport Component from '@glimmer/component';\n\nexport default class LikePostComponent extends Component {\n saveLike() {\n // ...snip...\n }\n}\n```\n\nIn this example, when the button is clicked `saveLike` will be invoked,\nit will **not** have access to the component instance. In other\nwords, it will have no `this` context, so please make sure your functions\nare bound (via an arrow function or other means) before passing into `on`!",
|
|
22123
22123
|
"itemtype": "method",
|
|
22124
22124
|
"name": "on",
|
|
22125
22125
|
"access": "public",
|
|
@@ -22827,7 +22827,7 @@
|
|
|
22827
22827
|
{
|
|
22828
22828
|
"file": "packages/@glimmer/syntax/dist/es/index.js",
|
|
22829
22829
|
"line": 9480,
|
|
22830
|
-
"description": "Parses and traverses a given
|
|
22830
|
+
"description": "Parses and traverses a given template to extract all template locals\nreferenced that could possible come from the parent scope. Can exclude known keywords\noptionally.",
|
|
22831
22831
|
"class": "@glimmer/tracking",
|
|
22832
22832
|
"module": "@glimmer/component"
|
|
22833
22833
|
},
|
|
@@ -24222,7 +24222,7 @@
|
|
|
24222
24222
|
{
|
|
24223
24223
|
"file": "packages/@glimmer/syntax/lib/get-template-locals.ts",
|
|
24224
24224
|
"line": 84,
|
|
24225
|
-
"description": "Parses and traverses a given
|
|
24225
|
+
"description": "Parses and traverses a given template to extract all template locals\nreferenced that could possible come from the parent scope. Can exclude known keywords\noptionally.",
|
|
24226
24226
|
"class": "@glimmer/tracking",
|
|
24227
24227
|
"module": "@glimmer/component"
|
|
24228
24228
|
},
|
|
@@ -24248,7 +24248,7 @@
|
|
|
24248
24248
|
{
|
|
24249
24249
|
"file": "packages/@glimmer/tracking/index.ts",
|
|
24250
24250
|
"line": 17,
|
|
24251
|
-
"description": "Marks a property as tracked. By default, values that are rendered in Ember app\ntemplates are _static_, meaning that updates to them won't cause the\napplication to rerender. Marking a property as tracked means that when that\nproperty changes, any templates that used that property, directly or\nindirectly, will rerender. For instance, consider this component:\n\n```
|
|
24251
|
+
"description": "Marks a property as tracked. By default, values that are rendered in Ember app\ntemplates are _static_, meaning that updates to them won't cause the\napplication to rerender. Marking a property as tracked means that when that\nproperty changes, any templates that used that property, directly or\nindirectly, will rerender. For instance, consider this component:\n\n```gjs\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\n\nexport default class CounterComponent extends Component {\n @tracked count = 0;\n\n get timesTen() {\n return this.count * 10;\n }\n\n @action\n plusOne() {\n this.count += 1;\n }\n \n <template>\n <div>Count: {{this.count}}</div>\n <div>Times Ten: {{this.timesTen}}</div>\n <div>\n <button {{on \"click\" this.plusOne}}>\n Plus One\n </button>\n </div>\n </template>\n}\n```\n\nBoth the `{{this.count}}` and the `{{this.timesTen}}` properties in the\ntemplate will update whenever the button is clicked. Any tracked properties\nthat are used in any way to calculate a value that is used in the template\nwill cause a rerender when updated - this includes through method calls and\nother means:\n\n```gjs\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nclass Entry {\n @tracked name;\n @tracked phoneNumber;\n\n constructor(name, phoneNumber) {\n this.name = name;\n this.phoneNumber = phoneNumber;\n }\n}\n\nexport default class PhoneBookComponent extends Component {\n entries = [\n new Entry('Pizza Palace', 5551234),\n new Entry('1st Street Cleaners', 5554321),\n new Entry('Plants R Us', 5552468),\n ];\n\n // Any usage of this property will update whenever any of the names in the\n // entries arrays are updated\n get names() {\n return this.entries.map(e => e.name);\n }\n\n // Any usage of this property will update whenever any of the numbers in the\n // entries arrays are updated\n get numbers() {\n return this.getFormattedNumbers();\n }\n\n getFormattedNumbers() {\n return this.entries\n .map(e => e.phoneNumber)\n .map(number => {\n let numberString = '' + number;\n\n return numberString.slice(0, 3) + '-' + numberString.slice(3);\n });\n }\n}\n```\n\nIt's important to note that setting tracked properties will always trigger an\nupdate, even if the property is set to the same value as it was before.\n\n```js\nlet entry = new Entry('Pizza Palace', 5551234);\n// if entry was used when rendering, this would cause a rerender, even though\n// the name is being set to the same value as it was before\nentry.name = entry.name;\n```\n\n`tracked` can also be used with the classic Ember object model in a similar\nmanner to classic computed properties:\n\n```javascript\nimport EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n name: tracked(),\n phoneNumber: tracked()\n});\n```\n\nOften this is unnecessary, but to ensure robust auto-tracking behavior it is\nadvisable to mark tracked state appropriately wherever possible.\nThis form of `tracked` also accepts an optional configuration object\ncontaining either an initial `value` or an `initializer` function (but not\nboth).\n\n```javascript\nimport EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n name: tracked({ value: 'Zoey' }),\n favoriteSongs: tracked({\n initializer: () => ['Raspberry Beret', 'Time After Time']\n })\n});\n```",
|
|
24252
24252
|
"itemtype": "method",
|
|
24253
24253
|
"name": "tracked",
|
|
24254
24254
|
"static": 1,
|
|
@@ -24548,7 +24548,7 @@
|
|
|
24548
24548
|
},
|
|
24549
24549
|
{
|
|
24550
24550
|
"message": "unknown tag: note",
|
|
24551
|
-
"line": " packages/@ember/-internals/glimmer/lib/helper.ts:
|
|
24551
|
+
"line": " packages/@ember/-internals/glimmer/lib/helper.ts:325"
|
|
24552
24552
|
},
|
|
24553
24553
|
{
|
|
24554
24554
|
"message": "unknown tag: decorator",
|
|
@@ -24736,11 +24736,11 @@
|
|
|
24736
24736
|
},
|
|
24737
24737
|
{
|
|
24738
24738
|
"message": "Missing item type\nThe HTML class attribute.",
|
|
24739
|
-
"line": " packages/@ember/-internals/glimmer/lib/components/input.ts:
|
|
24739
|
+
"line": " packages/@ember/-internals/glimmer/lib/components/input.ts:171"
|
|
24740
24740
|
},
|
|
24741
24741
|
{
|
|
24742
24742
|
"message": "Missing item type\nThe HTML type attribute.",
|
|
24743
|
-
"line": " packages/@ember/-internals/glimmer/lib/components/input.ts:
|
|
24743
|
+
"line": " packages/@ember/-internals/glimmer/lib/components/input.ts:182"
|
|
24744
24744
|
},
|
|
24745
24745
|
{
|
|
24746
24746
|
"message": "Missing item type\nThe default HTML id attribute. We don't really _need_ one, this is just\nadded for compatibility as it's hard to tell if people rely on it being\npresent, and it doens't really hurt.\n\nHowever, don't rely on this internally, like passing it to `getElementId`.\nThis can be (and often is) overriden by passing an `id` attribute on the\ninvocation, which shadows this default id via `...attributes`.",
|
|
@@ -24792,11 +24792,11 @@
|
|
|
24792
24792
|
},
|
|
24793
24793
|
{
|
|
24794
24794
|
"message": "Missing item type",
|
|
24795
|
-
"line": " packages/@ember/-internals/glimmer/lib/helper.ts:
|
|
24795
|
+
"line": " packages/@ember/-internals/glimmer/lib/helper.ts:135"
|
|
24796
24796
|
},
|
|
24797
24797
|
{
|
|
24798
24798
|
"message": "Missing item type\nThe type of a function-based helper.",
|
|
24799
|
-
"line": " packages/@ember/-internals/glimmer/lib/helper.ts:
|
|
24799
|
+
"line": " packages/@ember/-internals/glimmer/lib/helper.ts:325"
|
|
24800
24800
|
},
|
|
24801
24801
|
{
|
|
24802
24802
|
"message": "Missing item type\nDestroys the render tree and removes all rendered content from the element rendered into",
|
|
@@ -25144,47 +25144,47 @@
|
|
|
25144
25144
|
},
|
|
25145
25145
|
{
|
|
25146
25146
|
"message": "Missing item type\nThe final definition of NativeArray removes all native methods. This is the list of removed methods\nwhen run in Chrome 106.",
|
|
25147
|
-
"line": " packages/@ember/array/index.ts:
|
|
25147
|
+
"line": " packages/@ember/array/index.ts:1915"
|
|
25148
25148
|
},
|
|
25149
25149
|
{
|
|
25150
25150
|
"message": "Missing item type\nThese additional items must be redefined since `Omit` causes methods that return `this` to return the\ntype at the time of the Omit.",
|
|
25151
|
-
"line": " packages/@ember/array/index.ts:
|
|
25151
|
+
"line": " packages/@ember/array/index.ts:1932"
|
|
25152
25152
|
},
|
|
25153
25153
|
{
|
|
25154
25154
|
"message": "Missing item type\nRemove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.",
|
|
25155
|
-
"line": " packages/@ember/array/index.ts:
|
|
25155
|
+
"line": " packages/@ember/array/index.ts:1956"
|
|
25156
25156
|
},
|
|
25157
25157
|
{
|
|
25158
25158
|
"message": "Missing item type\nThis will use the primitive `replace()` method to insert an object at the\nspecified index.",
|
|
25159
|
-
"line": " packages/@ember/array/index.ts:
|
|
25159
|
+
"line": " packages/@ember/array/index.ts:1961"
|
|
25160
25160
|
},
|
|
25161
25161
|
{
|
|
25162
25162
|
"message": "Missing item type\nRemove an object at the specified index using the `replace()` primitive\nmethod. You can pass either a single index, or a start and a length.",
|
|
25163
|
-
"line": " packages/@ember/array/index.ts:
|
|
25163
|
+
"line": " packages/@ember/array/index.ts:1966"
|
|
25164
25164
|
},
|
|
25165
25165
|
{
|
|
25166
25166
|
"message": "Missing item type\nAdd the objects in the passed numerable to the end of the array. Defers\nnotifying observers of the change until all objects are added.",
|
|
25167
|
-
"line": " packages/@ember/array/index.ts:
|
|
25167
|
+
"line": " packages/@ember/array/index.ts:1971"
|
|
25168
25168
|
},
|
|
25169
25169
|
{
|
|
25170
25170
|
"message": "Missing item type\nAdds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.",
|
|
25171
|
-
"line": " packages/@ember/array/index.ts:
|
|
25171
|
+
"line": " packages/@ember/array/index.ts:1976"
|
|
25172
25172
|
},
|
|
25173
25173
|
{
|
|
25174
25174
|
"message": "Missing item type\nReverse objects in the array. Works just like `reverse()` but it is\nKVO-compliant.",
|
|
25175
|
-
"line": " packages/@ember/array/index.ts:
|
|
25175
|
+
"line": " packages/@ember/array/index.ts:1981"
|
|
25176
25176
|
},
|
|
25177
25177
|
{
|
|
25178
25178
|
"message": "Missing item type\nReplace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.",
|
|
25179
|
-
"line": " packages/@ember/array/index.ts:
|
|
25179
|
+
"line": " packages/@ember/array/index.ts:1986"
|
|
25180
25180
|
},
|
|
25181
25181
|
{
|
|
25182
25182
|
"message": "Missing item type\nRemoves each object in the passed array from the receiver.",
|
|
25183
|
-
"line": " packages/@ember/array/index.ts:
|
|
25183
|
+
"line": " packages/@ember/array/index.ts:2008"
|
|
25184
25184
|
},
|
|
25185
25185
|
{
|
|
25186
25186
|
"message": "Missing item type\nAdds each object in the passed enumerable to the receiver.",
|
|
25187
|
-
"line": " packages/@ember/array/index.ts:
|
|
25187
|
+
"line": " packages/@ember/array/index.ts:2029"
|
|
25188
25188
|
},
|
|
25189
25189
|
{
|
|
25190
25190
|
"message": "Missing item type",
|
|
@@ -25255,28 +25255,28 @@
|
|
|
25255
25255
|
"line": " packages/@ember/engine/instance.ts:132"
|
|
25256
25256
|
},
|
|
25257
25257
|
{
|
|
25258
|
-
"message": "Missing item type\nUsing the `{{hash}}` helper, you can pass objects directly from the template\nas an argument to your components.\n\n```\
|
|
25258
|
+
"message": "Missing item type\nUsing the `{{hash}}` helper, you can pass objects directly from the template\nas an argument to your components.\n\n```\n<template>\n {{#each-in (hash givenName='Jen' familyName='Weber') as |key value|}}\n <p>{{key}}: {{value}}</p>\n {{/each-in}}\n</template>\n```",
|
|
25259
25259
|
"line": " packages/@ember/helper/index.ts:346"
|
|
25260
25260
|
},
|
|
25261
25261
|
{
|
|
25262
|
-
"message": "Missing item type\nUsing the `{{array}}` helper, you can pass arrays directly from the template\nas an argument to your components.\n\n```js\
|
|
25263
|
-
"line": " packages/@ember/helper/index.ts:
|
|
25262
|
+
"message": "Missing item type\nUsing the `{{array}}` helper, you can pass arrays directly from the template\nas an argument to your components.\n\n```js\n\n<template>\n <ul>\n {{#each (array 'Tom Dale' 'Yehuda Katz' @anotherPerson) as |person|}}\n <li>{{person}}</li>\n {{/each}}\n </ul>\n</template>\n```",
|
|
25263
|
+
"line": " packages/@ember/helper/index.ts:361"
|
|
25264
25264
|
},
|
|
25265
25265
|
{
|
|
25266
|
-
"message": "Missing item type\nThe `{{concat}}` helper makes it easy to dynamically send a number of\nparameters to a component or helper as a single parameter in the format of a\nconcatenated string.\n\nFor example:\n\n```js\nimport { concat } from '@ember/helper';\n\n<template>\n {{get @foo (concat \"item\" @index)}}\n</template>\n```\n\nThis will display the result of `@foo.item1` when `index` is `1`, and\n`this.foo.item2` when `index` is `2`, etc
|
|
25267
|
-
"line": " packages/@ember/helper/index.ts:
|
|
25266
|
+
"message": "Missing item type\nThe `{{concat}}` helper makes it easy to dynamically send a number of\nparameters to a component or helper as a single parameter in the format of a\nconcatenated string.\n\nFor example:\n\n```js\nimport { concat } from '@ember/helper';\n\n<template>\n {{get @foo (concat \"item\" @index)}}\n</template>\n```\n\nThis will display the result of `@foo.item1` when `index` is `1`, and\n`this.foo.item2` when `index` is `2`, etc.",
|
|
25267
|
+
"line": " packages/@ember/helper/index.ts:379"
|
|
25268
25268
|
},
|
|
25269
25269
|
{
|
|
25270
|
-
"message": "Missing item type\nThe `{{get}}` helper makes it easy to dynamically look up a property on an\nobject or an element in an array. The second argument to `{{get}}` can be a\nstring or a number, depending on the object being accessed.\n\nTo access a property on an object with a string key:\n\n```js\nimport { get } from '@ember/helper';\n\n<template>\n {{get @someObject \"objectKey\"}}\n</template>\n```\n\nTo access the first element in an array:\n\n```js\nimport { get } from '@ember/helper';\n\n<template>\n {{get @someArray 0}}\n</template>\n```\n\nTo access a property on an object with a dynamic key:\n\n```js\nimport { get } from '@ember/helper';\n\n<template>\n {{get @address @field}}\n</template>\n```\n\nThis will display the result of `@foo.item1` when `index` is `1`, and\n`this.foo.item2` when `index` is `2`, etc
|
|
25271
|
-
"line": " packages/@ember/helper/index.ts:
|
|
25270
|
+
"message": "Missing item type\nThe `{{get}}` helper makes it easy to dynamically look up a property on an\nobject or an element in an array. The second argument to `{{get}}` can be a\nstring or a number, depending on the object being accessed.\n\nTo access a property on an object with a string key:\n\n```js\nimport { get } from '@ember/helper';\n\n<template>\n {{get @someObject \"objectKey\"}}\n</template>\n```\n\nTo access the first element in an array:\n\n```js\nimport { get } from '@ember/helper';\n\n<template>\n {{get @someArray 0}}\n</template>\n```\n\nTo access a property on an object with a dynamic key:\n\n```js\nimport { get } from '@ember/helper';\n\n<template>\n {{get @address @field}}\n</template>\n```\n\nThis will display the result of `@foo.item1` when `index` is `1`, and\n`this.foo.item2` when `index` is `2`, etc.",
|
|
25271
|
+
"line": " packages/@ember/helper/index.ts:400"
|
|
25272
25272
|
},
|
|
25273
25273
|
{
|
|
25274
25274
|
"message": "Missing item type\n`{{fn}}` is a helper that receives a function and some arguments, and returns\na new function that combines. This allows you to pass parameters along to\nfunctions in your templates:\n\n```js\nimport { fn } from '@ember/helper';\n\nfunction showAlert(message) {\n alert(`The message is: '${message}'`);\n}\n\n<template>\n <button type=\"button\" {{on \"click\" (fn showAlert \"Hello!\")}}>\n Click me!\n </button>\n</template>\n```",
|
|
25275
|
-
"line": " packages/@ember/helper/index.ts:
|
|
25275
|
+
"line": " packages/@ember/helper/index.ts:441"
|
|
25276
25276
|
},
|
|
25277
25277
|
{
|
|
25278
25278
|
"message": "Missing item type\nUse the {{uniqueId}} helper to generate a unique ID string suitable for use as\nan ID attribute in the DOM.\n\nEach invocation of {{uniqueId}} will return a new, unique ID string.\nYou can use the `let` helper to create an ID that can be reused within a template.\n\n```js\nimport { uniqueId } from '@ember/helper';\n\n<template>\n {{#let (uniqueId) as |emailId|}}\n <label for={{emailId}}>Email address</label>\n <input id={{emailId}} type=\"email\" />\n {{/let}}\n</template>\n```",
|
|
25279
|
-
"line": " packages/@ember/helper/index.ts:
|
|
25279
|
+
"line": " packages/@ember/helper/index.ts:578"
|
|
25280
25280
|
},
|
|
25281
25281
|
{
|
|
25282
25282
|
"message": "Missing item type",
|
|
@@ -26639,7 +26639,7 @@
|
|
|
26639
26639
|
"line": " packages/@glimmer/syntax/dist/es/index.js:9467"
|
|
26640
26640
|
},
|
|
26641
26641
|
{
|
|
26642
|
-
"message": "Missing item type\nParses and traverses a given
|
|
26642
|
+
"message": "Missing item type\nParses and traverses a given template to extract all template locals\nreferenced that could possible come from the parent scope. Can exclude known keywords\noptionally.",
|
|
26643
26643
|
"line": " packages/@glimmer/syntax/dist/es/index.js:9480"
|
|
26644
26644
|
},
|
|
26645
26645
|
{
|
|
@@ -27411,7 +27411,7 @@
|
|
|
27411
27411
|
"line": " packages/@glimmer/syntax/lib/get-template-locals.ts:65"
|
|
27412
27412
|
},
|
|
27413
27413
|
{
|
|
27414
|
-
"message": "Missing item type\nParses and traverses a given
|
|
27414
|
+
"message": "Missing item type\nParses and traverses a given template to extract all template locals\nreferenced that could possible come from the parent scope. Can exclude known keywords\noptionally.",
|
|
27415
27415
|
"line": " packages/@glimmer/syntax/lib/get-template-locals.ts:84"
|
|
27416
27416
|
},
|
|
27417
27417
|
{
|