ember-source 4.4.0-alpha.2 → 4.4.0-alpha.3
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/ember-template-compiler.js +8 -5
- package/dist/ember-template-compiler.map +1 -1
- package/dist/ember-testing.js +2 -2
- package/dist/ember-testing.map +1 -1
- package/dist/ember.debug.js +692 -583
- package/dist/ember.debug.map +1 -1
- package/dist/header/license.js +1 -1
- package/dist/packages/@ember/-internals/glimmer/index.js +37 -4
- package/dist/packages/@ember/-internals/metal/index.js +5 -13
- package/dist/packages/@ember/-internals/routing/lib/location/hash_location.js +1 -1
- package/dist/packages/@ember/-internals/routing/lib/services/router.js +65 -12
- package/dist/packages/@ember/-internals/routing/lib/system/route.js +1 -1
- package/dist/packages/@ember/-internals/routing/lib/system/router.js +10 -7
- package/dist/packages/@ember/-internals/runtime/lib/compare.js +19 -5
- package/dist/packages/@ember/-internals/runtime/lib/mixins/comparable.js +4 -4
- package/dist/packages/@ember/canary-features/index.js +4 -2
- package/dist/packages/@ember/debug/lib/handlers.js +1 -1
- package/dist/packages/@ember/runloop/index.js +31 -528
- package/dist/packages/@ember/runloop/type-tests.ts/begin-end.test.js +5 -0
- package/dist/packages/@ember/runloop/type-tests.ts/bind.test.js +59 -0
- package/dist/packages/@ember/runloop/type-tests.ts/cancel.test.js +5 -0
- package/dist/packages/@ember/runloop/type-tests.ts/debounce.test.js +77 -0
- package/dist/packages/@ember/runloop/type-tests.ts/join.test.js +38 -0
- package/dist/packages/@ember/runloop/type-tests.ts/later.test.js +38 -0
- package/dist/packages/@ember/runloop/type-tests.ts/next.test.js +38 -0
- package/dist/packages/@ember/runloop/type-tests.ts/once.test.js +38 -0
- package/dist/packages/@ember/runloop/type-tests.ts/run.test.js +38 -0
- package/dist/packages/@ember/runloop/type-tests.ts/schedule-once.test.js +39 -0
- package/dist/packages/@ember/runloop/type-tests.ts/schedule.test.js +39 -0
- package/dist/packages/@ember/runloop/type-tests.ts/throttle.test.js +77 -0
- package/dist/packages/ember/index.js +1 -0
- package/dist/packages/ember/version.js +1 -1
- package/docs/data.json +203 -102
- package/package.json +2 -2
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": "4.4.0-alpha.
|
|
6
|
+
"version": "4.4.0-alpha.3"
|
|
7
7
|
},
|
|
8
8
|
"files": {
|
|
9
9
|
"node_modules/rsvp/lib/rsvp/promise/all.js": {
|
|
@@ -414,6 +414,15 @@
|
|
|
414
414
|
},
|
|
415
415
|
"namespaces": {}
|
|
416
416
|
},
|
|
417
|
+
"packages/@ember/-internals/glimmer/lib/helpers/unique-id.ts": {
|
|
418
|
+
"name": "packages/@ember/-internals/glimmer/lib/helpers/unique-id.ts",
|
|
419
|
+
"modules": {},
|
|
420
|
+
"classes": {},
|
|
421
|
+
"fors": {
|
|
422
|
+
"Ember.Templates.helpers": 1
|
|
423
|
+
},
|
|
424
|
+
"namespaces": {}
|
|
425
|
+
},
|
|
417
426
|
"packages/@ember/-internals/glimmer/lib/modifiers/on.ts": {
|
|
418
427
|
"name": "packages/@ember/-internals/glimmer/lib/modifiers/on.ts",
|
|
419
428
|
"modules": {},
|
|
@@ -468,6 +477,13 @@
|
|
|
468
477
|
"fors": {},
|
|
469
478
|
"namespaces": {}
|
|
470
479
|
},
|
|
480
|
+
"packages/@ember/-internals/glimmer/lib/utils/managers.ts": {
|
|
481
|
+
"name": "packages/@ember/-internals/glimmer/lib/utils/managers.ts",
|
|
482
|
+
"modules": {},
|
|
483
|
+
"classes": {},
|
|
484
|
+
"fors": {},
|
|
485
|
+
"namespaces": {}
|
|
486
|
+
},
|
|
471
487
|
"packages/@ember/-internals/glimmer/lib/utils/outlet.ts": {
|
|
472
488
|
"name": "packages/@ember/-internals/glimmer/lib/utils/outlet.ts",
|
|
473
489
|
"modules": {},
|
|
@@ -1127,8 +1143,8 @@
|
|
|
1127
1143
|
"fors": {},
|
|
1128
1144
|
"namespaces": {}
|
|
1129
1145
|
},
|
|
1130
|
-
"packages/@ember/-internals/runtime/lib/compare.
|
|
1131
|
-
"name": "packages/@ember/-internals/runtime/lib/compare.
|
|
1146
|
+
"packages/@ember/-internals/runtime/lib/compare.ts": {
|
|
1147
|
+
"name": "packages/@ember/-internals/runtime/lib/compare.ts",
|
|
1132
1148
|
"modules": {},
|
|
1133
1149
|
"classes": {},
|
|
1134
1150
|
"fors": {
|
|
@@ -1136,8 +1152,8 @@
|
|
|
1136
1152
|
},
|
|
1137
1153
|
"namespaces": {}
|
|
1138
1154
|
},
|
|
1139
|
-
"packages/@ember/-internals/runtime/lib/is-equal.
|
|
1140
|
-
"name": "packages/@ember/-internals/runtime/lib/is-equal.
|
|
1155
|
+
"packages/@ember/-internals/runtime/lib/is-equal.ts": {
|
|
1156
|
+
"name": "packages/@ember/-internals/runtime/lib/is-equal.ts",
|
|
1141
1157
|
"modules": {},
|
|
1142
1158
|
"classes": {},
|
|
1143
1159
|
"fors": {
|
|
@@ -1145,8 +1161,8 @@
|
|
|
1145
1161
|
},
|
|
1146
1162
|
"namespaces": {}
|
|
1147
1163
|
},
|
|
1148
|
-
"packages/@ember/-internals/runtime/lib/type-of.
|
|
1149
|
-
"name": "packages/@ember/-internals/runtime/lib/type-of.
|
|
1164
|
+
"packages/@ember/-internals/runtime/lib/type-of.ts": {
|
|
1165
|
+
"name": "packages/@ember/-internals/runtime/lib/type-of.ts",
|
|
1150
1166
|
"modules": {},
|
|
1151
1167
|
"classes": {},
|
|
1152
1168
|
"fors": {
|
|
@@ -1562,8 +1578,8 @@
|
|
|
1562
1578
|
},
|
|
1563
1579
|
"namespaces": {}
|
|
1564
1580
|
},
|
|
1565
|
-
"packages/@ember/runloop/index.
|
|
1566
|
-
"name": "packages/@ember/runloop/index.
|
|
1581
|
+
"packages/@ember/runloop/index.ts": {
|
|
1582
|
+
"name": "packages/@ember/runloop/index.ts",
|
|
1567
1583
|
"modules": {
|
|
1568
1584
|
"@ember/runloop": 1
|
|
1569
1585
|
},
|
|
@@ -1899,7 +1915,7 @@
|
|
|
1899
1915
|
"tag": "module",
|
|
1900
1916
|
"file": "packages/@ember/-internals/glimmer/lib/glimmer-component-docs.ts",
|
|
1901
1917
|
"line": 1,
|
|
1902
|
-
"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 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/comopnents/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(...arguments);\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.",
|
|
1918
|
+
"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(...arguments);\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.",
|
|
1903
1919
|
"access": "public",
|
|
1904
1920
|
"tagname": ""
|
|
1905
1921
|
},
|
|
@@ -2062,7 +2078,7 @@
|
|
|
2062
2078
|
"namespaces": {},
|
|
2063
2079
|
"tag": "module",
|
|
2064
2080
|
"file": "packages/@ember/canary-features/index.ts",
|
|
2065
|
-
"line":
|
|
2081
|
+
"line": 22,
|
|
2066
2082
|
"description": "Set `EmberENV.FEATURES` in your application's `config/environment.js` file\nto enable canary features in your application.\n\nSee the [feature flag guide](https://guides.emberjs.com/release/configuring-ember/feature-flags/)\nfor more details.",
|
|
2067
2083
|
"access": "public",
|
|
2068
2084
|
"tagname": ""
|
|
@@ -2210,8 +2226,8 @@
|
|
|
2210
2226
|
},
|
|
2211
2227
|
"namespaces": {},
|
|
2212
2228
|
"tag": "module",
|
|
2213
|
-
"file": "packages/@ember/runloop/index.
|
|
2214
|
-
"line":
|
|
2229
|
+
"file": "packages/@ember/runloop/index.ts",
|
|
2230
|
+
"line": 96
|
|
2215
2231
|
},
|
|
2216
2232
|
"@ember/service": {
|
|
2217
2233
|
"name": "@ember/service",
|
|
@@ -2977,7 +2993,7 @@
|
|
|
2977
2993
|
"module": "@ember/routing",
|
|
2978
2994
|
"namespace": "",
|
|
2979
2995
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
2980
|
-
"line":
|
|
2996
|
+
"line": 139,
|
|
2981
2997
|
"description": "The `EmberRouter` class manages the application state and URLs. Refer to\nthe [routing guide](https://guides.emberjs.com/release/routing/) for documentation.",
|
|
2982
2998
|
"extends": "EmberObject",
|
|
2983
2999
|
"uses": [
|
|
@@ -3540,7 +3556,7 @@
|
|
|
3540
3556
|
"module": "@ember/canary-features",
|
|
3541
3557
|
"namespace": "",
|
|
3542
3558
|
"file": "packages/@ember/canary-features/index.ts",
|
|
3543
|
-
"line":
|
|
3559
|
+
"line": 22,
|
|
3544
3560
|
"description": "The hash of enabled Canary features. Add to this, any canary features\nbefore creating your application.",
|
|
3545
3561
|
"static": 1,
|
|
3546
3562
|
"since": "1.1.0",
|
|
@@ -5946,6 +5962,18 @@
|
|
|
5946
5962
|
"class": "Ember.Templates.helpers",
|
|
5947
5963
|
"module": "ember"
|
|
5948
5964
|
},
|
|
5965
|
+
{
|
|
5966
|
+
"file": "packages/@ember/-internals/glimmer/lib/helpers/unique-id.ts",
|
|
5967
|
+
"line": 5,
|
|
5968
|
+
"description": "Use the {{unique-id}} helper to generate a unique ID string suitable for use as\nan ID attribute in the DOM.\n\n```handlebars\n<input id={{unique-id}} type=\"email\" />\n```\nEach invocation of {{unique-id}} 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```handlebars\n{{#let (unique-id) as |emailId|}}\n <label for={{emailId}}>Email address</label>\n <input id={{emailId}} type=\"email\" />\n{{/let}}\n```",
|
|
5969
|
+
"itemtype": "method",
|
|
5970
|
+
"name": "unique-id",
|
|
5971
|
+
"since": "4.4.0",
|
|
5972
|
+
"access": "public",
|
|
5973
|
+
"tagname": "",
|
|
5974
|
+
"class": "Ember.Templates.helpers",
|
|
5975
|
+
"module": "ember"
|
|
5976
|
+
},
|
|
5949
5977
|
{
|
|
5950
5978
|
"file": "packages/@ember/-internals/glimmer/lib/modifiers/on.ts",
|
|
5951
5979
|
"line": 5,
|
|
@@ -6015,6 +6043,33 @@
|
|
|
6015
6043
|
"class": "Ember.Templates.helpers",
|
|
6016
6044
|
"module": "ember"
|
|
6017
6045
|
},
|
|
6046
|
+
{
|
|
6047
|
+
"file": "packages/@ember/-internals/glimmer/lib/utils/managers.ts",
|
|
6048
|
+
"line": 9,
|
|
6049
|
+
"description": "Associate a class with a component manager (an object that is responsible for\ncoordinating the lifecycle events that occurs when invoking, rendering and\nre-rendering a component).",
|
|
6050
|
+
"itemtype": "method",
|
|
6051
|
+
"name": "setComponentManager",
|
|
6052
|
+
"params": [
|
|
6053
|
+
{
|
|
6054
|
+
"name": "factory",
|
|
6055
|
+
"description": "a function to create the owner for an object",
|
|
6056
|
+
"type": "Function"
|
|
6057
|
+
},
|
|
6058
|
+
{
|
|
6059
|
+
"name": "obj",
|
|
6060
|
+
"description": "the object to associate with the componetn manager",
|
|
6061
|
+
"type": "Object"
|
|
6062
|
+
}
|
|
6063
|
+
],
|
|
6064
|
+
"return": {
|
|
6065
|
+
"description": "the same object passed in",
|
|
6066
|
+
"type": "Object"
|
|
6067
|
+
},
|
|
6068
|
+
"access": "public",
|
|
6069
|
+
"tagname": "",
|
|
6070
|
+
"class": "@ember/template",
|
|
6071
|
+
"module": "ember"
|
|
6072
|
+
},
|
|
6018
6073
|
{
|
|
6019
6074
|
"file": "packages/@ember/-internals/glimmer/lib/utils/outlet.ts",
|
|
6020
6075
|
"line": 5,
|
|
@@ -6112,13 +6167,13 @@
|
|
|
6112
6167
|
},
|
|
6113
6168
|
{
|
|
6114
6169
|
"file": "packages/@ember/-internals/glimmer/lib/views/outlet.ts",
|
|
6115
|
-
"line":
|
|
6170
|
+
"line": 107,
|
|
6116
6171
|
"class": "Component",
|
|
6117
6172
|
"module": "@ember/template"
|
|
6118
6173
|
},
|
|
6119
6174
|
{
|
|
6120
6175
|
"file": "packages/@ember/-internals/glimmer/lib/views/outlet.ts",
|
|
6121
|
-
"line":
|
|
6176
|
+
"line": 115,
|
|
6122
6177
|
"class": "Component",
|
|
6123
6178
|
"module": "@ember/template"
|
|
6124
6179
|
},
|
|
@@ -7098,7 +7153,7 @@
|
|
|
7098
7153
|
{
|
|
7099
7154
|
"file": "packages/@ember/-internals/metal/lib/events.ts",
|
|
7100
7155
|
"line": 160,
|
|
7101
|
-
"access": "
|
|
7156
|
+
"access": "public",
|
|
7102
7157
|
"tagname": "",
|
|
7103
7158
|
"itemtype": "method",
|
|
7104
7159
|
"name": "hasListeners",
|
|
@@ -7205,7 +7260,7 @@
|
|
|
7205
7260
|
{
|
|
7206
7261
|
"file": "packages/@ember/-internals/metal/lib/is_blank.ts",
|
|
7207
7262
|
"line": 5,
|
|
7208
|
-
"description": "A value is blank if it is empty or a whitespace string.\n\n```javascript\nimport { isBlank } from '@ember/utils';\n\nisBlank(
|
|
7263
|
+
"description": "A value is blank if it is empty or a whitespace string.\n\n```javascript\nimport { isBlank } from '@ember/utils';\n\nisBlank(null); // true\nisBlank(undefined); // true\nisBlank(''); // true\nisBlank([]); // true\nisBlank('\\n\\t'); // true\nisBlank(' '); // true\nisBlank({}); // false\nisBlank('\\n\\t Hello'); // false\nisBlank('Hello world'); // false\nisBlank([1,2,3]); // false\n```",
|
|
7209
7264
|
"itemtype": "method",
|
|
7210
7265
|
"name": "isBlank",
|
|
7211
7266
|
"static": 1,
|
|
@@ -7229,7 +7284,7 @@
|
|
|
7229
7284
|
{
|
|
7230
7285
|
"file": "packages/@ember/-internals/metal/lib/is_empty.ts",
|
|
7231
7286
|
"line": 5,
|
|
7232
|
-
"description": "Verifies that a value is `null` or `undefined`, an empty string, or an empty\narray.\n\nConstrains the rules on `isNone` by returning true for empty strings and\nempty arrays.\n\nIf the value is an object with a `size` property of type number, it is used\nto check emptiness.\n\n```javascript\nisEmpty(
|
|
7287
|
+
"description": "Verifies that a value is `null` or `undefined`, an empty string, or an empty\narray.\n\nConstrains the rules on `isNone` by returning true for empty strings and\nempty arrays.\n\nIf the value is an object with a `size` property of type number, it is used\nto check emptiness.\n\n```javascript\nisEmpty(null); // true\nisEmpty(undefined); // true\nisEmpty(''); // true\nisEmpty([]); // true\nisEmpty({ size: 0}); // true\nisEmpty({}); // false\nisEmpty('Adam Hawkins'); // false\nisEmpty([0,1,2]); // false\nisEmpty('\\n\\t'); // false\nisEmpty(' '); // false\nisEmpty({ size: 1 }) // false\nisEmpty({ size: () => 0 }) // false\n```",
|
|
7233
7288
|
"itemtype": "method",
|
|
7234
7289
|
"name": "isEmpty",
|
|
7235
7290
|
"static": 1,
|
|
@@ -7252,7 +7307,7 @@
|
|
|
7252
7307
|
{
|
|
7253
7308
|
"file": "packages/@ember/-internals/metal/lib/is_none.ts",
|
|
7254
7309
|
"line": 4,
|
|
7255
|
-
"description": "Returns true if the passed value is null or undefined. This avoids errors\nfrom JSLint complaining about use of ==, which can be technically\nconfusing.\n\n```javascript\nisNone(
|
|
7310
|
+
"description": "Returns true if the passed value is null or undefined. This avoids errors\nfrom JSLint complaining about use of ==, which can be technically\nconfusing.\n\n```javascript\nisNone(null); // true\nisNone(undefined); // true\nisNone(''); // false\nisNone([]); // false\nisNone(function() {}); // false\n```",
|
|
7256
7311
|
"itemtype": "method",
|
|
7257
7312
|
"name": "isNone",
|
|
7258
7313
|
"static": 1,
|
|
@@ -7275,7 +7330,7 @@
|
|
|
7275
7330
|
{
|
|
7276
7331
|
"file": "packages/@ember/-internals/metal/lib/is_present.ts",
|
|
7277
7332
|
"line": 5,
|
|
7278
|
-
"description": "A value is present if it not `isBlank`.\n\n```javascript\nisPresent(
|
|
7333
|
+
"description": "A value is present if it not `isBlank`.\n\n```javascript\nisPresent(null); // false\nisPresent(undefined); // false\nisPresent(''); // false\nisPresent(' '); // false\nisPresent('\\n\\t'); // false\nisPresent([]); // false\nisPresent({ length: 0 }); // false\nisPresent(false); // true\nisPresent(true); // true\nisPresent('string'); // true\nisPresent(0); // true\nisPresent(function() {}); // true\nisPresent({}); // true\nisPresent('\\n\\t Hello'); // true\nisPresent([1, 2, 3]); // true\n```",
|
|
7279
7334
|
"itemtype": "method",
|
|
7280
7335
|
"name": "isPresent",
|
|
7281
7336
|
"static": 1,
|
|
@@ -8553,7 +8608,7 @@
|
|
|
8553
8608
|
},
|
|
8554
8609
|
{
|
|
8555
8610
|
"file": "packages/@ember/-internals/routing/lib/services/router.ts",
|
|
8556
|
-
"line":
|
|
8611
|
+
"line": 140,
|
|
8557
8612
|
"description": "Similar to `transitionTo`, but instead of adding the destination to the browser's URL history,\nit replaces the entry for the current route.\nWhen the user clicks the \"back\" button in the browser, there will be fewer steps.\nThis is most commonly used to manage redirects in a way that does not cause confusing additions\nto the user's browsing history.\n\nCalling `replaceWith` from the Router service will cause default query parameter values to be included in the URL.\nThis behavior is different from calling `replaceWith` on a route.\nSee the [Router Service RFC](https://github.com/emberjs/rfcs/blob/master/text/0095-router-service.md#query-parameter-semantics) for more info.\n\nUsage example:\n\n```app/routes/application.js\nimport Route from '@ember/routing/route';\n\nexport default class extends Route {\n beforeModel() {\n if (!authorized()){\n this.replaceWith('unauthorized');\n }\n }\n});\n```",
|
|
8558
8613
|
"itemtype": "method",
|
|
8559
8614
|
"name": "replaceWith",
|
|
@@ -8586,7 +8641,7 @@
|
|
|
8586
8641
|
},
|
|
8587
8642
|
{
|
|
8588
8643
|
"file": "packages/@ember/-internals/routing/lib/services/router.ts",
|
|
8589
|
-
"line":
|
|
8644
|
+
"line": 179,
|
|
8590
8645
|
"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.hbs\n<CopyLink @author={{hash id=\"tomster\" name=\"Tomster\"}} />\n```\n\n```app/components/copy-link.js\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.hbs\n<CopyLink @author={{hash id=\"tomster\" name=\"Tomster\"}} />\n```\n\n```app/components/copy-link.js\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```",
|
|
8591
8646
|
"itemtype": "method",
|
|
8592
8647
|
"name": "urlFor",
|
|
@@ -8619,7 +8674,7 @@
|
|
|
8619
8674
|
},
|
|
8620
8675
|
{
|
|
8621
8676
|
"file": "packages/@ember/-internals/routing/lib/services/router.ts",
|
|
8622
|
-
"line":
|
|
8677
|
+
"line": 252,
|
|
8623
8678
|
"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.js\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.js\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.",
|
|
8624
8679
|
"itemtype": "method",
|
|
8625
8680
|
"name": "isActive",
|
|
@@ -8652,7 +8707,7 @@
|
|
|
8652
8707
|
},
|
|
8653
8708
|
{
|
|
8654
8709
|
"file": "packages/@ember/-internals/routing/lib/services/router.ts",
|
|
8655
|
-
"line":
|
|
8710
|
+
"line": 356,
|
|
8656
8711
|
"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```\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```",
|
|
8657
8712
|
"itemtype": "method",
|
|
8658
8713
|
"name": "recognize",
|
|
@@ -8674,7 +8729,7 @@
|
|
|
8674
8729
|
},
|
|
8675
8730
|
{
|
|
8676
8731
|
"file": "packages/@ember/-internals/routing/lib/services/router.ts",
|
|
8677
|
-
"line":
|
|
8732
|
+
"line": 397,
|
|
8678
8733
|
"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`.",
|
|
8679
8734
|
"itemtype": "method",
|
|
8680
8735
|
"name": "recognizeAndLoad",
|
|
@@ -8696,8 +8751,54 @@
|
|
|
8696
8751
|
},
|
|
8697
8752
|
{
|
|
8698
8753
|
"file": "packages/@ember/-internals/routing/lib/services/router.ts",
|
|
8699
|
-
"line":
|
|
8700
|
-
"description": "
|
|
8754
|
+
"line": 419,
|
|
8755
|
+
"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```",
|
|
8756
|
+
"itemtype": "method",
|
|
8757
|
+
"name": "on",
|
|
8758
|
+
"params": [
|
|
8759
|
+
{
|
|
8760
|
+
"name": "eventName",
|
|
8761
|
+
"description": "",
|
|
8762
|
+
"type": "String"
|
|
8763
|
+
},
|
|
8764
|
+
{
|
|
8765
|
+
"name": "callback",
|
|
8766
|
+
"description": "",
|
|
8767
|
+
"type": "Function"
|
|
8768
|
+
}
|
|
8769
|
+
],
|
|
8770
|
+
"access": "public",
|
|
8771
|
+
"tagname": "",
|
|
8772
|
+
"class": "RouterService",
|
|
8773
|
+
"module": "@ember/routing"
|
|
8774
|
+
},
|
|
8775
|
+
{
|
|
8776
|
+
"file": "packages/@ember/-internals/routing/lib/services/router.ts",
|
|
8777
|
+
"line": 446,
|
|
8778
|
+
"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 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```",
|
|
8779
|
+
"itemtype": "method",
|
|
8780
|
+
"name": "off",
|
|
8781
|
+
"params": [
|
|
8782
|
+
{
|
|
8783
|
+
"name": "eventName",
|
|
8784
|
+
"description": "",
|
|
8785
|
+
"type": "String"
|
|
8786
|
+
},
|
|
8787
|
+
{
|
|
8788
|
+
"name": "callback",
|
|
8789
|
+
"description": "",
|
|
8790
|
+
"type": "Function"
|
|
8791
|
+
}
|
|
8792
|
+
],
|
|
8793
|
+
"access": "public",
|
|
8794
|
+
"tagname": "",
|
|
8795
|
+
"class": "RouterService",
|
|
8796
|
+
"module": "@ember/routing"
|
|
8797
|
+
},
|
|
8798
|
+
{
|
|
8799
|
+
"file": "packages/@ember/-internals/routing/lib/services/router.ts",
|
|
8800
|
+
"line": 478,
|
|
8801
|
+
"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.",
|
|
8701
8802
|
"itemtype": "event",
|
|
8702
8803
|
"name": "routeWillChange",
|
|
8703
8804
|
"params": [
|
|
@@ -8714,8 +8815,8 @@
|
|
|
8714
8815
|
},
|
|
8715
8816
|
{
|
|
8716
8817
|
"file": "packages/@ember/-internals/routing/lib/services/router.ts",
|
|
8717
|
-
"line":
|
|
8718
|
-
"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
|
|
8818
|
+
"line": 512,
|
|
8819
|
+
"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.",
|
|
8719
8820
|
"itemtype": "event",
|
|
8720
8821
|
"name": "routeDidChange",
|
|
8721
8822
|
"params": [
|
|
@@ -8732,7 +8833,7 @@
|
|
|
8732
8833
|
},
|
|
8733
8834
|
{
|
|
8734
8835
|
"file": "packages/@ember/-internals/routing/lib/services/router.ts",
|
|
8735
|
-
"line":
|
|
8836
|
+
"line": 553,
|
|
8736
8837
|
"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.",
|
|
8737
8838
|
"itemtype": "method",
|
|
8738
8839
|
"name": "refresh",
|
|
@@ -8757,7 +8858,7 @@
|
|
|
8757
8858
|
},
|
|
8758
8859
|
{
|
|
8759
8860
|
"file": "packages/@ember/-internals/routing/lib/services/router.ts",
|
|
8760
|
-
"line":
|
|
8861
|
+
"line": 590,
|
|
8761
8862
|
"description": "Name of the current route.\n\n This property represents the logical name of the route,\n which is comma 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`",
|
|
8762
8863
|
"itemtype": "property",
|
|
8763
8864
|
"name": "currentRouteName",
|
|
@@ -8769,7 +8870,7 @@
|
|
|
8769
8870
|
},
|
|
8770
8871
|
{
|
|
8771
8872
|
"file": "packages/@ember/-internals/routing/lib/services/router.ts",
|
|
8772
|
-
"line":
|
|
8873
|
+
"line": 620,
|
|
8773
8874
|
"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`",
|
|
8774
8875
|
"itemtype": "property",
|
|
8775
8876
|
"name": "currentURL",
|
|
@@ -8781,7 +8882,7 @@
|
|
|
8781
8882
|
},
|
|
8782
8883
|
{
|
|
8783
8884
|
"file": "packages/@ember/-internals/routing/lib/services/router.ts",
|
|
8784
|
-
"line":
|
|
8885
|
+
"line": 649,
|
|
8785
8886
|
"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`auto`, `hash`, `history`, `none`.\n\nSee [HashLocation](/ember/release/classes/HashLocation).\nSee [HistoryLocation](/ember/release/classes/HistoryLocation).\nSee [NoneLocation](/ember/release/classes/NoneLocation).\nSee [AutoLocation](/ember/release/classes/AutoLocation).",
|
|
8786
8887
|
"itemtype": "property",
|
|
8787
8888
|
"name": "location",
|
|
@@ -8796,7 +8897,7 @@
|
|
|
8796
8897
|
},
|
|
8797
8898
|
{
|
|
8798
8899
|
"file": "packages/@ember/-internals/routing/lib/services/router.ts",
|
|
8799
|
-
"line":
|
|
8900
|
+
"line": 689,
|
|
8800
8901
|
"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`.",
|
|
8801
8902
|
"itemtype": "property",
|
|
8802
8903
|
"name": "rootURL",
|
|
@@ -8808,7 +8909,7 @@
|
|
|
8808
8909
|
},
|
|
8809
8910
|
{
|
|
8810
8911
|
"file": "packages/@ember/-internals/routing/lib/services/router.ts",
|
|
8811
|
-
"line":
|
|
8912
|
+
"line": 719,
|
|
8812
8913
|
"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.js\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```",
|
|
8813
8914
|
"itemtype": "property",
|
|
8814
8915
|
"name": "currentRoute",
|
|
@@ -10128,7 +10229,7 @@
|
|
|
10128
10229
|
},
|
|
10129
10230
|
{
|
|
10130
10231
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10131
|
-
"line":
|
|
10232
|
+
"line": 149,
|
|
10132
10233
|
"description": "Represents the URL of the root of the application, often '/'. This prefix is\n assumed on all routes defined on this router.",
|
|
10133
10234
|
"itemtype": "property",
|
|
10134
10235
|
"name": "rootURL",
|
|
@@ -10140,7 +10241,7 @@
|
|
|
10140
10241
|
},
|
|
10141
10242
|
{
|
|
10142
10243
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10143
|
-
"line":
|
|
10244
|
+
"line": 160,
|
|
10144
10245
|
"description": "The `location` property determines the type of URL's that your\n application will use.\n\n The following location types are currently available:\n\n * `history` - use the browser's history API to make the URLs look just like any standard URL\n * `hash` - use `#` to separate the server part of the URL from the Ember part: `/blog/#/posts/new`\n * `none` - do not store the Ember URL in the actual browser URL (mainly used for testing)\n * `auto` - use the best option based on browser capabilities: `history` if possible, then `hash` if possible, otherwise `none`\n\n This value is defaulted to `auto` by the `locationType` setting of `/config/environment.js`",
|
|
10145
10246
|
"itemtype": "property",
|
|
10146
10247
|
"name": "location",
|
|
@@ -10155,7 +10256,7 @@
|
|
|
10155
10256
|
},
|
|
10156
10257
|
{
|
|
10157
10258
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10158
|
-
"line":
|
|
10259
|
+
"line": 218,
|
|
10159
10260
|
"description": "The `Router.map` function allows you to define mappings from URLs to routes\nin your application. These mappings are defined within the\nsupplied callback function using `this.route`.\n\nThe first parameter is the name of the route which is used by default as the\npath name as well.\n\nThe second parameter is the optional options hash. Available options are:\n\n * `path`: allows you to provide your own path as well as mark dynamic\n segments.\n * `resetNamespace`: false by default; when nesting routes, ember will\n combine the route names to form the fully-qualified route name, which is\n used with `{{link-to}}` or manually transitioning to routes. Setting\n `resetNamespace: true` will cause the route not to inherit from its\n parent route's names. This is handy for preventing extremely long route names.\n Keep in mind that the actual URL path behavior is still retained.\n\nThe third parameter is a function, which can be used to nest routes.\nNested routes, by default, will have the parent route tree's route name and\npath prepended to it's own.\n\n```app/router.js\nRouter.map(function(){\n this.route('post', { path: '/post/:post_id' }, function() {\n this.route('edit');\n this.route('comments', { resetNamespace: true }, function() {\n this.route('new');\n });\n });\n});\n```",
|
|
10160
10261
|
"itemtype": "method",
|
|
10161
10262
|
"name": "map",
|
|
@@ -10172,7 +10273,7 @@
|
|
|
10172
10273
|
},
|
|
10173
10274
|
{
|
|
10174
10275
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10175
|
-
"line":
|
|
10276
|
+
"line": 547,
|
|
10176
10277
|
"description": "Initializes the current router instance and sets up the change handling\nevent listeners used by the instances `location` implementation.\n\nA property named `initialURL` will be used to determine the initial URL.\nIf no value is found `/` will be used.",
|
|
10177
10278
|
"itemtype": "method",
|
|
10178
10279
|
"name": "startRouting",
|
|
@@ -10183,7 +10284,7 @@
|
|
|
10183
10284
|
},
|
|
10184
10285
|
{
|
|
10185
10286
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10186
|
-
"line":
|
|
10287
|
+
"line": 670,
|
|
10187
10288
|
"description": "Transition the application into another route. The route may\nbe either a single route or route path:",
|
|
10188
10289
|
"itemtype": "method",
|
|
10189
10290
|
"name": "transitionTo",
|
|
@@ -10217,7 +10318,7 @@
|
|
|
10217
10318
|
},
|
|
10218
10319
|
{
|
|
10219
10320
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10220
|
-
"line":
|
|
10321
|
+
"line": 715,
|
|
10221
10322
|
"description": "Similar to `transitionTo`, but instead of adding the destination to the browser's URL history,\nit replaces the entry for the current route.\nWhen the user clicks the \"back\" button in the browser, there will be fewer steps.\nThis is most commonly used to manage redirects in a way that does not cause confusing additions\nto the user's browsing history.",
|
|
10222
10323
|
"itemtype": "method",
|
|
10223
10324
|
"name": "replaceWith",
|
|
@@ -10251,7 +10352,7 @@
|
|
|
10251
10352
|
},
|
|
10252
10353
|
{
|
|
10253
10354
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10254
|
-
"line":
|
|
10355
|
+
"line": 742,
|
|
10255
10356
|
"description": "Determines if the supplied route is currently active.",
|
|
10256
10357
|
"itemtype": "method",
|
|
10257
10358
|
"name": "isActive",
|
|
@@ -10272,7 +10373,7 @@
|
|
|
10272
10373
|
},
|
|
10273
10374
|
{
|
|
10274
10375
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10275
|
-
"line":
|
|
10376
|
+
"line": 754,
|
|
10276
10377
|
"description": "An alternative form of `isActive` that doesn't require\nmanual concatenation of the arguments into a single\narray.",
|
|
10277
10378
|
"itemtype": "method",
|
|
10278
10379
|
"name": "isActiveIntent",
|
|
@@ -10302,7 +10403,7 @@
|
|
|
10302
10403
|
},
|
|
10303
10404
|
{
|
|
10304
10405
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10305
|
-
"line":
|
|
10406
|
+
"line": 776,
|
|
10306
10407
|
"description": "Does this router instance have the given route.",
|
|
10307
10408
|
"itemtype": "method",
|
|
10308
10409
|
"name": "hasRoute",
|
|
@@ -10317,7 +10418,7 @@
|
|
|
10317
10418
|
},
|
|
10318
10419
|
{
|
|
10319
10420
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10320
|
-
"line":
|
|
10421
|
+
"line": 787,
|
|
10321
10422
|
"description": "Resets the state of the router by clearing the current route\nhandlers and deactivating them.",
|
|
10322
10423
|
"access": "private",
|
|
10323
10424
|
"tagname": "",
|
|
@@ -10328,7 +10429,7 @@
|
|
|
10328
10429
|
},
|
|
10329
10430
|
{
|
|
10330
10431
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10331
|
-
"line":
|
|
10432
|
+
"line": 935,
|
|
10332
10433
|
"description": "Serializes the given query params according to their QP meta information.",
|
|
10333
10434
|
"access": "private",
|
|
10334
10435
|
"tagname": "",
|
|
@@ -10355,7 +10456,7 @@
|
|
|
10355
10456
|
},
|
|
10356
10457
|
{
|
|
10357
10458
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10358
|
-
"line":
|
|
10459
|
+
"line": 965,
|
|
10359
10460
|
"description": "Serializes the value of a query parameter based on a type",
|
|
10360
10461
|
"access": "private",
|
|
10361
10462
|
"tagname": "",
|
|
@@ -10378,7 +10479,7 @@
|
|
|
10378
10479
|
},
|
|
10379
10480
|
{
|
|
10380
10481
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10381
|
-
"line":
|
|
10482
|
+
"line": 983,
|
|
10382
10483
|
"description": "Deserializes the given query params according to their QP meta information.",
|
|
10383
10484
|
"access": "private",
|
|
10384
10485
|
"tagname": "",
|
|
@@ -10405,7 +10506,7 @@
|
|
|
10405
10506
|
},
|
|
10406
10507
|
{
|
|
10407
10508
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10408
|
-
"line":
|
|
10509
|
+
"line": 1011,
|
|
10409
10510
|
"description": "Deserializes the value of a query parameter based on a default type",
|
|
10410
10511
|
"access": "private",
|
|
10411
10512
|
"tagname": "",
|
|
@@ -10428,7 +10529,7 @@
|
|
|
10428
10529
|
},
|
|
10429
10530
|
{
|
|
10430
10531
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10431
|
-
"line":
|
|
10532
|
+
"line": 1032,
|
|
10432
10533
|
"description": "Removes (prunes) any query params with default values from the given QP\nobject. Default values are determined from the QP meta information per key.",
|
|
10433
10534
|
"access": "private",
|
|
10434
10535
|
"tagname": "",
|
|
@@ -10455,7 +10556,7 @@
|
|
|
10455
10556
|
},
|
|
10456
10557
|
{
|
|
10457
10558
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10458
|
-
"line":
|
|
10559
|
+
"line": 1113,
|
|
10459
10560
|
"description": "Prepares the query params for a URL or Transition. Restores any undefined QP\nkeys/values, serializes all values, and then prunes any default values.",
|
|
10460
10561
|
"access": "private",
|
|
10461
10562
|
"tagname": "",
|
|
@@ -10492,7 +10593,7 @@
|
|
|
10492
10593
|
},
|
|
10493
10594
|
{
|
|
10494
10595
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10495
|
-
"line":
|
|
10596
|
+
"line": 1140,
|
|
10496
10597
|
"description": "Returns the meta information for the query params of a given route. This\nwill be overridden to allow support for lazy routes.",
|
|
10497
10598
|
"access": "private",
|
|
10498
10599
|
"tagname": "",
|
|
@@ -10514,7 +10615,7 @@
|
|
|
10514
10615
|
},
|
|
10515
10616
|
{
|
|
10516
10617
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10517
|
-
"line":
|
|
10618
|
+
"line": 1154,
|
|
10518
10619
|
"description": "Returns a merged query params meta object for a given set of routeInfos.\nUseful for knowing what query params are available for a given route hierarchy.",
|
|
10519
10620
|
"access": "private",
|
|
10520
10621
|
"tagname": "",
|
|
@@ -10536,7 +10637,7 @@
|
|
|
10536
10637
|
},
|
|
10537
10638
|
{
|
|
10538
10639
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10539
|
-
"line":
|
|
10640
|
+
"line": 1216,
|
|
10540
10641
|
"description": "Maps all query param keys to their fully scoped property name of the form\n`controllerName:propName`.",
|
|
10541
10642
|
"access": "private",
|
|
10542
10643
|
"tagname": "",
|
|
@@ -10568,7 +10669,7 @@
|
|
|
10568
10669
|
},
|
|
10569
10670
|
{
|
|
10570
10671
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10571
|
-
"line":
|
|
10672
|
+
"line": 1254,
|
|
10572
10673
|
"description": "Hydrates (adds/restores) any query params that have pre-existing values into\nthe given queryParams hash. This is what allows query params to be \"sticky\"\nand restore their last known values for their scope.",
|
|
10573
10674
|
"access": "private",
|
|
10574
10675
|
"tagname": "",
|
|
@@ -10595,7 +10696,7 @@
|
|
|
10595
10696
|
},
|
|
10596
10697
|
{
|
|
10597
10698
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10598
|
-
"line":
|
|
10699
|
+
"line": 1425,
|
|
10599
10700
|
"description": "Handles updating the paths and notifying any listeners of the URL\nchange.\n\nTriggers the router level `didTransition` hook.\n\nFor example, to notify google analytics when the route changes,\nyou could use this hook. (Note: requires also including GA scripts, etc.)\n\n```javascript\nimport config from './config/environment';\nimport EmberRouter from '@ember/routing/router';\nimport { service } from '@ember/service';\n\nlet Router = EmberRouter.extend({\n location: config.locationType,\n\n router: service(),\n\n didTransition: function() {\n this._super(...arguments);\n\n ga('send', 'pageview', {\n page: this.router.currentURL,\n title: this.router.currentRouteName,\n });\n }\n});\n```",
|
|
10600
10701
|
"itemtype": "method",
|
|
10601
10702
|
"name": "didTransition",
|
|
@@ -10607,7 +10708,7 @@
|
|
|
10607
10708
|
},
|
|
10608
10709
|
{
|
|
10609
10710
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10610
|
-
"line":
|
|
10711
|
+
"line": 1462,
|
|
10611
10712
|
"description": "Handles notifying any listeners of an impending URL\nchange.\n\nTriggers the router level `willTransition` hook.",
|
|
10612
10713
|
"itemtype": "method",
|
|
10613
10714
|
"name": "willTransition",
|
|
@@ -10619,7 +10720,7 @@
|
|
|
10619
10720
|
},
|
|
10620
10721
|
{
|
|
10621
10722
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10622
|
-
"line":
|
|
10723
|
+
"line": 1475,
|
|
10623
10724
|
"description": "Represents the current URL.",
|
|
10624
10725
|
"itemtype": "property",
|
|
10625
10726
|
"name": "url",
|
|
@@ -10631,7 +10732,7 @@
|
|
|
10631
10732
|
},
|
|
10632
10733
|
{
|
|
10633
10734
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10634
|
-
"line":
|
|
10735
|
+
"line": 1633,
|
|
10635
10736
|
"description": "Finds the name of the substate route if it exists for the given route. A\nsubstate route is of the form `route_state`, such as `foo_loading`.",
|
|
10636
10737
|
"access": "private",
|
|
10637
10738
|
"tagname": "",
|
|
@@ -10656,7 +10757,7 @@
|
|
|
10656
10757
|
},
|
|
10657
10758
|
{
|
|
10658
10759
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10659
|
-
"line":
|
|
10760
|
+
"line": 1654,
|
|
10660
10761
|
"description": "Finds the name of the state route if it exists for the given route. A state\nroute is of the form `route.state`, such as `foo.loading`. Properly Handles\n`application` named routes.",
|
|
10661
10762
|
"access": "private",
|
|
10662
10763
|
"tagname": "",
|
|
@@ -10681,7 +10782,7 @@
|
|
|
10681
10782
|
},
|
|
10682
10783
|
{
|
|
10683
10784
|
"file": "packages/@ember/-internals/routing/lib/system/router.ts",
|
|
10684
|
-
"line":
|
|
10785
|
+
"line": 1676,
|
|
10685
10786
|
"description": "Determines whether or not a route has been defined by checking that the route\nis in the Router's map and the owner has a registration for that route.",
|
|
10686
10787
|
"access": "private",
|
|
10687
10788
|
"tagname": "",
|
|
@@ -13791,8 +13892,8 @@
|
|
|
13791
13892
|
"module": "@ember/application"
|
|
13792
13893
|
},
|
|
13793
13894
|
{
|
|
13794
|
-
"file": "packages/@ember/-internals/runtime/lib/compare.
|
|
13795
|
-
"line":
|
|
13895
|
+
"file": "packages/@ember/-internals/runtime/lib/compare.ts",
|
|
13896
|
+
"line": 48,
|
|
13796
13897
|
"description": "Compares two javascript values and returns:\n\n - -1 if the first is smaller than the second,\n - 0 if both are equal,\n - 1 if the first is greater than the second.\n\n ```javascript\n import { compare } from '@ember/utils';\n\n compare('hello', 'hello'); // 0\n compare('abc', 'dfg'); // -1\n compare(2, 1); // 1\n ```\n\nIf the types of the two objects are different precedence occurs in the\nfollowing order, with types earlier in the list considered `<` types\nlater in the list:\n\n - undefined\n - null\n - boolean\n - number\n - string\n - array\n - object\n - instance\n - function\n - class\n - date\n\n ```javascript\n import { compare } from '@ember/utils';\n\n compare('hello', 50); // 1\n compare(50, 'hello'); // -1\n ```",
|
|
13797
13898
|
"itemtype": "method",
|
|
13798
13899
|
"name": "compare",
|
|
@@ -13819,7 +13920,7 @@
|
|
|
13819
13920
|
"module": "@ember/utils"
|
|
13820
13921
|
},
|
|
13821
13922
|
{
|
|
13822
|
-
"file": "packages/@ember/-internals/runtime/lib/is-equal.
|
|
13923
|
+
"file": "packages/@ember/-internals/runtime/lib/is-equal.ts",
|
|
13823
13924
|
"line": 4,
|
|
13824
13925
|
"description": "Compares two objects, returning true if they are equal.\n\n```javascript\nimport { isEqual } from '@ember/utils';\n\nisEqual('hello', 'hello'); // true\nisEqual(1, 2); // false\n```\n\n`isEqual` is a more specific comparison than a triple equal comparison.\nIt will call the `isEqual` instance method on the objects being\ncompared, allowing finer control over when objects should be considered\nequal to each other.\n\n```javascript\nimport { isEqual } from '@ember/utils';\nimport EmberObject from '@ember/object';\n\nlet Person = EmberObject.extend({\n isEqual(other) { return this.ssn == other.ssn; }\n});\n\nlet personA = Person.create({name: 'Muhammad Ali', ssn: '123-45-6789'});\nlet personB = Person.create({name: 'Cassius Clay', ssn: '123-45-6789'});\n\nisEqual(personA, personB); // true\n```\n\nDue to the expense of array comparisons, collections will never be equal to\neach other even if each of their items are equal to each other.\n\n```javascript\nimport { isEqual } from '@ember/utils';\n\nisEqual([4, 2], [4, 2]); // false\n```",
|
|
13825
13926
|
"itemtype": "method",
|
|
@@ -13847,8 +13948,8 @@
|
|
|
13847
13948
|
"module": "@ember/utils"
|
|
13848
13949
|
},
|
|
13849
13950
|
{
|
|
13850
|
-
"file": "packages/@ember/-internals/runtime/lib/type-of.
|
|
13851
|
-
"line":
|
|
13951
|
+
"file": "packages/@ember/-internals/runtime/lib/type-of.ts",
|
|
13952
|
+
"line": 40,
|
|
13852
13953
|
"description": "Returns a consistent type for the passed object.\n\nUse this instead of the built-in `typeof` to get the type of an item.\nIt will return the same result across all browsers and includes a bit\nmore detail. Here is what will be returned:\n\n | Return Value | Meaning |\n |---------------|------------------------------------------------------|\n | 'string' | String primitive or String object. |\n | 'number' | Number primitive or Number object. |\n | 'boolean' | Boolean primitive or Boolean object. |\n | 'null' | Null value |\n | 'undefined' | Undefined value |\n | 'function' | A function |\n | 'array' | An instance of Array |\n | 'regexp' | An instance of RegExp |\n | 'date' | An instance of Date |\n | 'filelist' | An instance of FileList |\n | 'class' | An Ember class (created using EmberObject.extend()) |\n | 'instance' | An Ember object instance |\n | 'error' | An instance of the Error object |\n | 'object' | A JavaScript object not inheriting from EmberObject |\n\nExamples:\n\n```javascript\nimport { A } from '@ember/array';\nimport { typeOf } from '@ember/utils';\nimport EmberObject from '@ember/object';\n\ntypeOf(); // 'undefined'\ntypeOf(null); // 'null'\ntypeOf(undefined); // 'undefined'\ntypeOf('michael'); // 'string'\ntypeOf(new String('michael')); // 'string'\ntypeOf(101); // 'number'\ntypeOf(new Number(101)); // 'number'\ntypeOf(true); // 'boolean'\ntypeOf(new Boolean(true)); // 'boolean'\ntypeOf(A); // 'function'\ntypeOf(A()); // 'array'\ntypeOf([1, 2, 90]); // 'array'\ntypeOf(/abc/); // 'regexp'\ntypeOf(new Date()); // 'date'\ntypeOf(event.target.files); // 'filelist'\ntypeOf(EmberObject.extend()); // 'class'\ntypeOf(EmberObject.create()); // 'instance'\ntypeOf(new Error('teamocil')); // 'error'\n\n// 'normal' JavaScript object\ntypeOf({ a: 'b' }); // 'object'\n```",
|
|
13853
13954
|
"itemtype": "method",
|
|
13854
13955
|
"name": "typeOf",
|
|
@@ -15307,7 +15408,7 @@
|
|
|
15307
15408
|
},
|
|
15308
15409
|
{
|
|
15309
15410
|
"file": "packages/@ember/canary-features/index.ts",
|
|
15310
|
-
"line":
|
|
15411
|
+
"line": 33,
|
|
15311
15412
|
"description": "Determine whether the specified `feature` is enabled. Used by Ember's\nbuild tools to exclude experimental features from beta/stable builds.\n\nYou can define the following configuration options:\n\n* `EmberENV.ENABLE_OPTIONAL_FEATURES` - enable any features that have not been explicitly\n enabled/disabled.",
|
|
15312
15413
|
"itemtype": "method",
|
|
15313
15414
|
"name": "isEnabled",
|
|
@@ -17311,8 +17412,8 @@
|
|
|
17311
17412
|
"module": "@ember/polyfills"
|
|
17312
17413
|
},
|
|
17313
17414
|
{
|
|
17314
|
-
"file": "packages/@ember/runloop/index.
|
|
17315
|
-
"line":
|
|
17415
|
+
"file": "packages/@ember/runloop/index.ts",
|
|
17416
|
+
"line": 60,
|
|
17316
17417
|
"description": "Array of named queues. This array determines the order in which queues\nare flushed at the end of the RunLoop. You can define your own queues by\nsimply adding the queue name to this array. Normally you should not need\nto inspect or modify this property.",
|
|
17317
17418
|
"itemtype": "property",
|
|
17318
17419
|
"name": "queues",
|
|
@@ -17324,8 +17425,8 @@
|
|
|
17324
17425
|
"module": "@ember/polyfills"
|
|
17325
17426
|
},
|
|
17326
17427
|
{
|
|
17327
|
-
"file": "packages/@ember/runloop/index.
|
|
17328
|
-
"line":
|
|
17428
|
+
"file": "packages/@ember/runloop/index.ts",
|
|
17429
|
+
"line": 103,
|
|
17329
17430
|
"description": "Runs the passed target and method inside of a RunLoop, ensuring any\ndeferred actions including bindings and views updates are flushed at the\nend.\n\nNormally you should not need to invoke this method yourself. However if\nyou are implementing raw event handlers when interfacing with other\nlibraries or plugins, you should probably wrap all of your code inside this\ncall.\n\n```javascript\nimport { run } from '@ember/runloop';\n\nrun(function() {\n // code to be executed within a RunLoop\n});\n```",
|
|
17330
17431
|
"itemtype": "method",
|
|
17331
17432
|
"name": "run",
|
|
@@ -17359,8 +17460,8 @@
|
|
|
17359
17460
|
"module": "@ember/runloop"
|
|
17360
17461
|
},
|
|
17361
17462
|
{
|
|
17362
|
-
"file": "packages/@ember/runloop/index.
|
|
17363
|
-
"line":
|
|
17463
|
+
"file": "packages/@ember/runloop/index.ts",
|
|
17464
|
+
"line": 147,
|
|
17364
17465
|
"description": "If no run-loop is present, it creates a new one. If a run loop is\npresent it will queue itself to run on the existing run-loops action\nqueue.\n\nPlease note: This is not for normal usage, and should be used sparingly.\n\nIf invoked when not within a run loop:\n\n```javascript\nimport { join } from '@ember/runloop';\n\njoin(function() {\n // creates a new run-loop\n});\n```\n\nAlternatively, if called within an existing run loop:\n\n```javascript\nimport { run, join } from '@ember/runloop';\n\nrun(function() {\n // creates a new run-loop\n\n join(function() {\n // joins with the existing run-loop, and queues for invocation on\n // the existing run-loops action queue.\n });\n});\n```",
|
|
17365
17466
|
"itemtype": "method",
|
|
17366
17467
|
"name": "join",
|
|
@@ -17394,8 +17495,8 @@
|
|
|
17394
17495
|
"module": "@ember/runloop"
|
|
17395
17496
|
},
|
|
17396
17497
|
{
|
|
17397
|
-
"file": "packages/@ember/runloop/index.
|
|
17398
|
-
"line":
|
|
17498
|
+
"file": "packages/@ember/runloop/index.ts",
|
|
17499
|
+
"line": 209,
|
|
17399
17500
|
"description": "Allows you to specify which context to call the specified function in while\nadding the execution of that function to the Ember run loop. This ability\nmakes this method a great way to asynchronously integrate third-party libraries\ninto your Ember application.\n\n`bind` takes two main arguments, the desired context and the function to\ninvoke in that context. Any additional arguments will be supplied as arguments\nto the function that is passed in.\n\nLet's use the creation of a TinyMCE component as an example. Currently,\nTinyMCE provides a setup configuration option we can use to do some processing\nafter the TinyMCE instance is initialized but before it is actually rendered.\nWe can use that setup option to do some additional setup for our component.\nThe component itself could look something like the following:\n\n```app/components/rich-text-editor.js\nimport Component from '@ember/component';\nimport { on } from '@ember/object/evented';\nimport { bind } from '@ember/runloop';\n\nexport default Component.extend({\n initializeTinyMCE: on('didInsertElement', function() {\n tinymce.init({\n selector: '#' + this.$().prop('id'),\n setup: bind(this, this.setupEditor)\n });\n }),\n\n didInsertElement() {\n tinymce.init({\n selector: '#' + this.$().prop('id'),\n setup: bind(this, this.setupEditor)\n });\n }\n\n setupEditor(editor) {\n this.set('editor', editor);\n\n editor.on('change', function() {\n console.log('content changed!');\n });\n }\n});\n```\n\nIn this example, we use `bind` to bind the setupEditor method to the\ncontext of the RichTextEditor component and to have the invocation of that\nmethod be safely handled and executed by the Ember run loop.",
|
|
17400
17501
|
"itemtype": "method",
|
|
17401
17502
|
"name": "bind",
|
|
@@ -17430,8 +17531,8 @@
|
|
|
17430
17531
|
"module": "@ember/runloop"
|
|
17431
17532
|
},
|
|
17432
17533
|
{
|
|
17433
|
-
"file": "packages/@ember/runloop/index.
|
|
17434
|
-
"line":
|
|
17534
|
+
"file": "packages/@ember/runloop/index.ts",
|
|
17535
|
+
"line": 323,
|
|
17435
17536
|
"description": "Begins a new RunLoop. Any deferred actions invoked after the begin will\nbe buffered until you invoke a matching call to `end()`. This is\na lower-level way to use a RunLoop instead of using `run()`.\n\n```javascript\nimport { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();\n```",
|
|
17436
17537
|
"itemtype": "method",
|
|
17437
17538
|
"name": "begin",
|
|
@@ -17446,8 +17547,8 @@
|
|
|
17446
17547
|
"module": "@ember/runloop"
|
|
17447
17548
|
},
|
|
17448
17549
|
{
|
|
17449
|
-
"file": "packages/@ember/runloop/index.
|
|
17450
|
-
"line":
|
|
17550
|
+
"file": "packages/@ember/runloop/index.ts",
|
|
17551
|
+
"line": 346,
|
|
17451
17552
|
"description": "Ends a RunLoop. This must be called sometime after you call\n`begin()` to flush any deferred actions. This is a lower-level way\nto use a RunLoop instead of using `run()`.\n\n```javascript\nimport { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();\n```",
|
|
17452
17553
|
"itemtype": "method",
|
|
17453
17554
|
"name": "end",
|
|
@@ -17462,8 +17563,8 @@
|
|
|
17462
17563
|
"module": "@ember/runloop"
|
|
17463
17564
|
},
|
|
17464
17565
|
{
|
|
17465
|
-
"file": "packages/@ember/runloop/index.
|
|
17466
|
-
"line":
|
|
17566
|
+
"file": "packages/@ember/runloop/index.ts",
|
|
17567
|
+
"line": 369,
|
|
17467
17568
|
"description": "Adds the passed target/method and any optional arguments to the named\nqueue to be executed at the end of the RunLoop. If you have not already\nstarted a RunLoop when calling this method one will be started for you\nautomatically.\n\nAt the end of a RunLoop, any methods scheduled in this way will be invoked.\nMethods will be invoked in an order matching the named queues defined in\nthe `queues` property.\n\n```javascript\nimport { schedule } from '@ember/runloop';\n\nschedule('afterRender', this, function() {\n // this will be executed in the 'afterRender' queue\n console.log('scheduled on afterRender queue');\n});\n\nschedule('actions', this, function() {\n // this will be executed in the 'actions' queue\n console.log('scheduled on actions queue');\n});\n\n// Note the functions will be run in order based on the run queues order.\n// Output would be:\n// scheduled on actions queue\n// scheduled on afterRender queue\n```",
|
|
17468
17569
|
"itemtype": "method",
|
|
17469
17570
|
"name": "schedule",
|
|
@@ -17502,8 +17603,8 @@
|
|
|
17502
17603
|
"module": "@ember/runloop"
|
|
17503
17604
|
},
|
|
17504
17605
|
{
|
|
17505
|
-
"file": "packages/@ember/runloop/index.
|
|
17506
|
-
"line":
|
|
17606
|
+
"file": "packages/@ember/runloop/index.ts",
|
|
17607
|
+
"line": 442,
|
|
17507
17608
|
"description": "Invokes the passed target/method and optional arguments after a specified\nperiod of time. The last parameter of this method must always be a number\nof milliseconds.\n\nYou should use this method whenever you need to run some action after a\nperiod of time instead of using `setTimeout()`. This method will ensure that\nitems that expire during the same script execution cycle all execute\ntogether, which is often more efficient than using a real setTimeout.\n\n```javascript\nimport { later } from '@ember/runloop';\n\nlater(myContext, function() {\n // code here will execute within a RunLoop in about 500ms with this == myContext\n}, 500);\n```",
|
|
17508
17609
|
"itemtype": "method",
|
|
17509
17610
|
"name": "later",
|
|
@@ -17542,8 +17643,8 @@
|
|
|
17542
17643
|
"module": "@ember/runloop"
|
|
17543
17644
|
},
|
|
17544
17645
|
{
|
|
17545
|
-
"file": "packages/@ember/runloop/index.
|
|
17546
|
-
"line":
|
|
17646
|
+
"file": "packages/@ember/runloop/index.ts",
|
|
17647
|
+
"line": 493,
|
|
17547
17648
|
"description": "Schedule a function to run one time during the current RunLoop. This is equivalent\n to calling `scheduleOnce` with the \"actions\" queue.",
|
|
17548
17649
|
"itemtype": "method",
|
|
17549
17650
|
"name": "once",
|
|
@@ -17577,8 +17678,8 @@
|
|
|
17577
17678
|
"module": "@ember/runloop"
|
|
17578
17679
|
},
|
|
17579
17680
|
{
|
|
17580
|
-
"file": "packages/@ember/runloop/index.
|
|
17581
|
-
"line":
|
|
17681
|
+
"file": "packages/@ember/runloop/index.ts",
|
|
17682
|
+
"line": 524,
|
|
17582
17683
|
"description": "Schedules a function to run one time in a given queue of the current RunLoop.\nCalling this method with the same queue/target/method combination will have\nno effect (past the initial call).\n\nNote that although you can pass optional arguments these will not be\nconsidered when looking for duplicates. New arguments will replace previous\ncalls.\n\n```javascript\nimport { run, scheduleOnce } from '@ember/runloop';\n\nfunction sayHi() {\n console.log('hi');\n}\n\nrun(function() {\n scheduleOnce('afterRender', myContext, sayHi);\n scheduleOnce('afterRender', myContext, sayHi);\n // sayHi will only be executed once, in the afterRender queue of the RunLoop\n});\n```\n\nAlso note that for `scheduleOnce` to prevent additional calls, you need to\npass the same function instance. The following case works as expected:\n\n```javascript\nfunction log() {\n console.log('Logging only once');\n}\n\nfunction scheduleIt() {\n scheduleOnce('actions', myContext, log);\n}\n\nscheduleIt();\nscheduleIt();\n```\n\nBut this other case will schedule the function multiple times:\n\n```javascript\nimport { scheduleOnce } from '@ember/runloop';\n\nfunction scheduleIt() {\n scheduleOnce('actions', myContext, function() {\n console.log('Closure');\n });\n}\n\nscheduleIt();\nscheduleIt();\n\n// \"Closure\" will print twice, even though we're using `scheduleOnce`,\n// because the function we pass to it won't match the\n// previously scheduled operation.\n```\n\nAvailable queues, and their order, can be found at `queues`",
|
|
17583
17684
|
"itemtype": "method",
|
|
17584
17685
|
"name": "scheduleOnce",
|
|
@@ -17618,8 +17719,8 @@
|
|
|
17618
17719
|
"module": "@ember/runloop"
|
|
17619
17720
|
},
|
|
17620
17721
|
{
|
|
17621
|
-
"file": "packages/@ember/runloop/index.
|
|
17622
|
-
"line":
|
|
17722
|
+
"file": "packages/@ember/runloop/index.ts",
|
|
17723
|
+
"line": 618,
|
|
17623
17724
|
"description": "Schedules an item to run from within a separate run loop, after\ncontrol has been returned to the system. This is equivalent to calling\n`later` with a wait time of 1ms.\n\n```javascript\nimport { next } from '@ember/runloop';\n\nnext(myContext, function() {\n // code to be executed in the next run loop,\n // which will be scheduled after the current one\n});\n```\n\nMultiple operations scheduled with `next` will coalesce\ninto the same later run loop, along with any other operations\nscheduled by `later` that expire right around the same\ntime that `next` operations will fire.\n\nNote that there are often alternatives to using `next`.\nFor instance, if you'd like to schedule an operation to happen\nafter all DOM element operations have completed within the current\nrun loop, you can make use of the `afterRender` run loop queue (added\nby the `ember-views` package, along with the preceding `render` queue\nwhere all the DOM element operations happen).\n\nExample:\n\n```app/components/my-component.js\nimport Component from '@ember/component';\nimport { scheduleOnce } from '@ember/runloop';\n\nexport Component.extend({\n didInsertElement() {\n this._super(...arguments);\n scheduleOnce('afterRender', this, 'processChildElements');\n },\n\n processChildElements() {\n // ... do something with component's child component\n // elements after they've finished rendering, which\n // can't be done within this component's\n // `didInsertElement` hook because that gets run\n // before the child elements have been added to the DOM.\n }\n});\n```\n\nOne benefit of the above approach compared to using `next` is\nthat you will be able to perform DOM/CSS operations before unprocessed\nelements are rendered to the screen, which may prevent flickering or\nother artifacts caused by delaying processing until after rendering.\n\nThe other major benefit to the above approach is that `next`\nintroduces an element of non-determinism, which can make things much\nharder to test, due to its reliance on `setTimeout`; it's much harder\nto guarantee the order of scheduled operations when they are scheduled\noutside of the current run loop, i.e. with `next`.",
|
|
17624
17725
|
"itemtype": "method",
|
|
17625
17726
|
"name": "next",
|
|
@@ -17653,8 +17754,8 @@
|
|
|
17653
17754
|
"module": "@ember/runloop"
|
|
17654
17755
|
},
|
|
17655
17756
|
{
|
|
17656
|
-
"file": "packages/@ember/runloop/index.
|
|
17657
|
-
"line":
|
|
17757
|
+
"file": "packages/@ember/runloop/index.ts",
|
|
17758
|
+
"line": 703,
|
|
17658
17759
|
"description": "Cancels a scheduled item. Must be a value returned by `later()`,\n`once()`, `scheduleOnce()`, `next()`, `debounce()`, or\n`throttle()`.\n\n```javascript\nimport {\n next,\n cancel,\n later,\n scheduleOnce,\n once,\n throttle,\n debounce\n} from '@ember/runloop';\n\nlet runNext = next(myContext, function() {\n // will not be executed\n});\n\ncancel(runNext);\n\nlet runLater = later(myContext, function() {\n // will not be executed\n}, 500);\n\ncancel(runLater);\n\nlet runScheduleOnce = scheduleOnce('afterRender', myContext, function() {\n // will not be executed\n});\n\ncancel(runScheduleOnce);\n\nlet runOnce = once(myContext, function() {\n // will not be executed\n});\n\ncancel(runOnce);\n\nlet throttle = throttle(myContext, function() {\n // will not be executed\n}, 1, false);\n\ncancel(throttle);\n\nlet debounce = debounce(myContext, function() {\n // will not be executed\n}, 1);\n\ncancel(debounce);\n\nlet debounceImmediate = debounce(myContext, function() {\n // will be executed since we passed in true (immediate)\n}, 100, true);\n\n// the 100ms delay until this method can be called again will be canceled\ncancel(debounceImmediate);\n```",
|
|
17659
17760
|
"itemtype": "method",
|
|
17660
17761
|
"name": "cancel",
|
|
@@ -17676,8 +17777,8 @@
|
|
|
17676
17777
|
"module": "@ember/runloop"
|
|
17677
17778
|
},
|
|
17678
17779
|
{
|
|
17679
|
-
"file": "packages/@ember/runloop/index.
|
|
17680
|
-
"line":
|
|
17780
|
+
"file": "packages/@ember/runloop/index.ts",
|
|
17781
|
+
"line": 774,
|
|
17681
17782
|
"description": "Delay calling the target method until the debounce period has elapsed\nwith no additional debounce calls. If `debounce` is called again before\nthe specified time has elapsed, the timer is reset and the entire period\nmust pass again before the target method is called.\n\nThis method should be used when an event may be called multiple times\nbut the action should only be called once when the event is done firing.\nA common example is for scroll events where you only want updates to\nhappen once scrolling has ceased.\n\n```javascript\nimport { debounce } from '@ember/runloop';\n\nfunction whoRan() {\n console.log(this.name + ' ran.');\n}\n\nlet myContext = { name: 'debounce' };\n\ndebounce(myContext, whoRan, 150);\n\n// less than 150ms passes\ndebounce(myContext, whoRan, 150);\n\n// 150ms passes\n// whoRan is invoked with context myContext\n// console logs 'debounce ran.' one time.\n```\n\nImmediate allows you to run the function immediately, but debounce\nother calls for this function until the wait time has elapsed. If\n`debounce` is called again before the specified time has elapsed,\nthe timer is reset and the entire period must pass again before\nthe method can be called again.\n\n```javascript\nimport { debounce } from '@ember/runloop';\n\nfunction whoRan() {\n console.log(this.name + ' ran.');\n}\n\nlet myContext = { name: 'debounce' };\n\ndebounce(myContext, whoRan, 150, true);\n\n// console logs 'debounce ran.' one time immediately.\n// 100ms passes\ndebounce(myContext, whoRan, 150, true);\n\n// 150ms passes and nothing else is logged to the console and\n// the debouncee is no longer being watched\ndebounce(myContext, whoRan, 150, true);\n\n// console logs 'debounce ran.' one time immediately.\n// 150ms passes and nothing else is logged to the console and\n// the debouncee is no longer being watched\n```",
|
|
17682
17783
|
"itemtype": "method",
|
|
17683
17784
|
"name": "debounce",
|
|
@@ -17721,8 +17822,8 @@
|
|
|
17721
17822
|
"module": "@ember/runloop"
|
|
17722
17823
|
},
|
|
17723
17824
|
{
|
|
17724
|
-
"file": "packages/@ember/runloop/index.
|
|
17725
|
-
"line":
|
|
17825
|
+
"file": "packages/@ember/runloop/index.ts",
|
|
17826
|
+
"line": 871,
|
|
17726
17827
|
"description": "Ensure that the target method is never called more frequently than\nthe specified spacing period. The target method is called immediately.\n\n```javascript\nimport { throttle } from '@ember/runloop';\n\nfunction whoRan() {\n console.log(this.name + ' ran.');\n}\n\nlet myContext = { name: 'throttle' };\n\nthrottle(myContext, whoRan, 150);\n// whoRan is invoked with context myContext\n// console logs 'throttle ran.'\n\n// 50ms passes\nthrottle(myContext, whoRan, 150);\n\n// 50ms passes\nthrottle(myContext, whoRan, 150);\n\n// 150ms passes\nthrottle(myContext, whoRan, 150);\n// whoRan is invoked with context myContext\n// console logs 'throttle ran.'\n```",
|
|
17727
17828
|
"itemtype": "method",
|
|
17728
17829
|
"name": "throttle",
|
|
@@ -18587,11 +18688,11 @@
|
|
|
18587
18688
|
},
|
|
18588
18689
|
{
|
|
18589
18690
|
"message": "Missing item type",
|
|
18590
|
-
"line": " packages/@ember/-internals/glimmer/lib/views/outlet.ts:
|
|
18691
|
+
"line": " packages/@ember/-internals/glimmer/lib/views/outlet.ts:107"
|
|
18591
18692
|
},
|
|
18592
18693
|
{
|
|
18593
18694
|
"message": "Missing item type",
|
|
18594
|
-
"line": " packages/@ember/-internals/glimmer/lib/views/outlet.ts:
|
|
18695
|
+
"line": " packages/@ember/-internals/glimmer/lib/views/outlet.ts:115"
|
|
18595
18696
|
},
|
|
18596
18697
|
{
|
|
18597
18698
|
"message": "Missing item type\nThe template-compiler does not support strict mode at this time.\nprecompile from ember-template-compiler returns a string and\nnot a template-factory, so it doesn't help with strict-mode testing.\n\nWe also can't import from `@ember/template-compiler` because it\ndoesn't exist to this kind of test, otherwise we'd be able to use\nprecompileTemplate, which would be perfect :D\n\nCopied(ish) from https://github.com/NullVoxPopuli/ember-repl/blob/main/addon/hbs.ts#L51",
|
|
@@ -18847,15 +18948,15 @@
|
|
|
18847
18948
|
},
|
|
18848
18949
|
{
|
|
18849
18950
|
"message": "Missing item type\nFinds the name of the substate route if it exists for the given route. A\nsubstate route is of the form `route_state`, such as `foo_loading`.",
|
|
18850
|
-
"line": " packages/@ember/-internals/routing/lib/system/router.ts:
|
|
18951
|
+
"line": " packages/@ember/-internals/routing/lib/system/router.ts:1633"
|
|
18851
18952
|
},
|
|
18852
18953
|
{
|
|
18853
18954
|
"message": "Missing item type\nFinds the name of the state route if it exists for the given route. A state\nroute is of the form `route.state`, such as `foo.loading`. Properly Handles\n`application` named routes.",
|
|
18854
|
-
"line": " packages/@ember/-internals/routing/lib/system/router.ts:
|
|
18955
|
+
"line": " packages/@ember/-internals/routing/lib/system/router.ts:1654"
|
|
18855
18956
|
},
|
|
18856
18957
|
{
|
|
18857
18958
|
"message": "Missing item type\nDetermines whether or not a route has been defined by checking that the route\nis in the Router's map and the owner has a registration for that route.",
|
|
18858
|
-
"line": " packages/@ember/-internals/routing/lib/system/router.ts:
|
|
18959
|
+
"line": " packages/@ember/-internals/routing/lib/system/router.ts:1676"
|
|
18859
18960
|
},
|
|
18860
18961
|
{
|
|
18861
18962
|
"message": "Missing item type",
|